From: Dmitry Stogov Date: Wed, 1 Aug 2007 10:39:33 +0000 (+0000) Subject: Fixed bug #42151 (__destruct functions not called after catching a SoapFault exception) X-Git-Tag: php-5.2.4RC1~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8589a7f4736b693c0398c51df8c2603755ba481d;p=php Fixed bug #42151 (__destruct functions not called after catching a SoapFault exception) --- diff --git a/NEWS b/NEWS index d5f3c409d9..e17841036a 100644 --- a/NEWS +++ b/NEWS @@ -70,6 +70,8 @@ PHP NEWS - Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory already exists). (Pierre) +- Fixed bug #42151 (__destruct functions not called after catching a SoapFault + exception). (Dmitry) - Fixed bug #42142 (substr_replace() returns FALSE when length > string length). (Ilia) - Fixed bug #42135 (Second call of session_start() causes creation of SID). diff --git a/ext/soap/soap.c b/ext/soap/soap.c index e3584b134c..1eb3abe638 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2067,6 +2067,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const #ifdef va_copy va_list argcopy; #endif + zend_object_store_bucket *old_objects; int old = PG(display_errors); INIT_ZVAL(outbuf); @@ -2093,6 +2094,8 @@ static void soap_error_handler(int error_num, const char *error_filename, const 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); @@ -2101,6 +2104,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const 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 { diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt new file mode 100755 index 0000000000..7f7a87bd15 --- /dev/null +++ b/ext/soap/tests/bugs/bug42151.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #42151 __destruct functions not called after catching a SoapFault exception +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; +} +echo "ok\n"; +?> +--EXPECT-- +SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' +ok +I don't get executed either.