mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- Fix crash in destructors(). You can't throw an exception in destructors
as there is no guaranteed time when the destructor will be called.
This commit is contained in:
parent
161ed69721
commit
8912a50bf4
1 changed files with 8 additions and 0 deletions
|
@ -68,7 +68,15 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
|
|||
zobj.value.obj.handlers = &std_object_handlers;
|
||||
INIT_PZVAL(obj);
|
||||
|
||||
if (EG(exception)) {
|
||||
zval_ptr_dtor(&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));
|
||||
EG(exception) = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue