1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00

MFH Fix handling of exceptions in dtors

This commit is contained in:
Marcus Boerger
2004-09-06 19:16:35 +00:00
parent c2c1590d52
commit 9ae0e91ef4
+6 -3
View File
@@ -76,10 +76,13 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
old_exception = EG(exception);
EG(exception) = NULL;
zend_call_method_with_0_params(&obj, object->ce, NULL, "__destruct", NULL);
if (EG(exception)) {
zval_ptr_dtor(&EG(exception));
if (old_exception) {
if (EG(exception)) {
zend_error(E_ERROR, "Ignoring exception from %s::__destruct() while an exception is already active", object->ce->name);
zval_ptr_dtor(&EG(exception));
}
EG(exception) = old_exception;
}
EG(exception) = old_exception;
}
}