diff options
author | Andi Gutmans <andi@php.net> | 2004-05-23 20:33:09 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2004-05-23 20:33:09 +0000 |
commit | 0b0c5d3fac9c1e9fc590840d912a040b099a87fc (patch) | |
tree | 7e04b791652237f3eeb61aedac2e36edd0cfb99e | |
parent | ef9878647df7bac9deb79bc2d691557a724dce21 (diff) | |
download | php-git-0b0c5d3fac9c1e9fc590840d912a040b099a87fc.tar.gz |
- Fix problem with object being destroyed more than once
-rw-r--r-- | Zend/zend_objects_API.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 69a33b525b..a5788bd437 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -48,10 +48,12 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS if (objects->object_buckets[i].valid) { struct _store_object *obj = &objects->object_buckets[i].bucket.obj; - if (obj->dtor && !objects->object_buckets[i].destructor_called) { - obj->dtor(obj->object, i TSRMLS_CC); + if (!objects->object_buckets[i].destructor_called) { + objects->object_buckets[i].destructor_called = 1; + if (obj->dtor) { + obj->dtor(obj->object, i TSRMLS_CC); + } } - objects->object_buckets[i].destructor_called = 1; } } } |