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

- Fix handling of exceptions in dtors

This commit is contained in:
Marcus Boerger
2004-09-06 19:13:33 +00:00
parent 963200c74c
commit dd5652e4c1
+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;
}
}