diff options
author | Andi Gutmans <andi@php.net> | 2004-03-01 19:45:07 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-03-01 19:45:07 +0000 |
commit | 8912a50bf47e70a16fc45a6cd085fc1b3e4d88a5 (patch) | |
tree | e4e4a2790d7c0e0214b4f7979f570da84a76703a /Zend/zend_objects.c | |
parent | 161ed69721b64b6f04b015f0bba30a09cbed3652 (diff) | |
download | php-git-8912a50bf47e70a16fc45a6cd085fc1b3e4d88a5.tar.gz |
- Fix crash in destructors(). You can't throw an exception in destructors
as there is no guaranteed time when the destructor will be called.
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r-- | Zend/zend_objects.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index d29795e3aa..bc4ac86f34 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -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; + } } } |