- Fix problem with object being destroyed more than once

This commit is contained in:
Andi Gutmans 2004-05-23 20:33:09 +00:00
parent ef9878647d
commit 0b0c5d3fac

View File

@ -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;
}
}
}