dmitry Wed Aug 1 10:39:49 2007 UTC
Modified files:
/php-src/ext/soap soap.c
/php-src/ext/soap/tests/bugs bug42151.phpt
Log:
Fixed bug #42151 (__destruct functions not called after catching a SoapFault
exception)
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.225&r2=1.226&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.225 php-src/ext/soap/soap.c:1.226
--- php-src/ext/soap/soap.c:1.225 Fri Jul 13 14:01:11 2007
+++ php-src/ext/soap/soap.c Wed Aug 1 10:39:49 2007
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: soap.c,v 1.225 2007/07/13 14:01:11 dmitry Exp $ */
+/* $Id: soap.c,v 1.226 2007/08/01 10:39:49 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -2377,6 +2377,7 @@
#ifdef va_copy
va_list argcopy;
#endif
+ zend_object_store_bucket *old_objects;
int old = PG(display_errors);
INIT_ZVAL(outbuf);
@@ -2400,6 +2401,8 @@
INIT_PZVAL(exception);
zend_throw_exception_object(exception TSRMLS_CC);
+ old_objects = EG(objects_store).object_buckets;
+ EG(objects_store).object_buckets = NULL;
PG(display_errors) = 0;
zend_try {
call_old_error_handler(error_num,
error_filename, error_lineno, format, args);
@@ -2408,6 +2411,7 @@
EG(in_execution) = _old_in_execution;
EG(current_execute_data) =
_old_current_execute_data;
} zend_end_try();
+ EG(objects_store).object_buckets = old_objects;
PG(display_errors) = old;
zend_bailout();
} else {
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42151.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug42151.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug42151.phpt:1.2
--- /dev/null Wed Aug 1 10:39:49 2007
+++ php-src/ext/soap/tests/bugs/bug42151.phpt Wed Aug 1 10:39:49 2007
@@ -0,0 +1,31 @@
+--TEST--
+Bug #42151 __destruct functions not called after catching a SoapFault exception
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class foo {
+ function __construct(){
+ $foo = @ new SoapClient('httpx://');
+ }
+ function __destruct(){
+ echo 'I never get executed.' . "\n";
+ }
+}
+class bar {
+ function __destruct(){
+ echo 'I don\'t get executed either.' . "\n";
+ }
+}
+try {
+ $bar = new bar();
+ $foo = new foo();
+} catch (Exception $e){
+ echo $e->getMessage() . "\n";
+}
+echo "ok\n";
+?>
+--EXPECT--
+SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://'
+ok
+I don't get executed either.
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php