zend_try {
/* Cleanup static data for functions and arrays.
- We need separate cleanup stage because of the following problem:
- Suppose we destroy class X, which destroys function table,
- and in function table we have function foo() that has static $bar. Now if
- object of class X is assigned to $bar, its destructor will be called and will
- fail since X's function table is in mid-destruction.
+ We need a separate cleanup stage because of the following problem:
+ Suppose we destroy class X, which destroys the class's function table,
+ and in the function table we have function foo() that has static $bar.
+ Now if an object of class X is assigned to $bar, its destructor will be
+ called and will fail since X's function table is in mid-destruction.
So we want first of all to clean up all data and then move to tables destruction.
Note that only run-time accessed data need to be cleaned up, pre-defined data can
not contain objects and thus are not probelmatic */
ZEND_API zend_object_handlers std_object_handlers = {
zend_objects_store_add_ref, /* add_ref */
zend_objects_store_del_ref, /* del_ref */
- zend_objects_store_delete_obj, /* delete_obj */
zend_objects_clone_obj, /* clone_obj */
zend_std_read_property, /* read_property */
/* general object functions */
zend_object_add_ref_t add_ref;
zend_object_del_ref_t del_ref;
- zend_object_delete_obj_t delete_obj;
zend_object_clone_obj_t clone_obj;
/* individual object functions */
zend_object_read_property_t read_property;
}
}
+
+ZEND_API void zend_objects_store_nuke_objects()
+{
+}
+
+
/* Store objects API */
ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_store_clone_t clone TSRMLS_DC)
#endif
}
-ZEND_API void zend_objects_store_delete_obj(zval *zobject TSRMLS_DC)
-{
- zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
- struct _store_object *obj = &EG(objects_store).object_buckets[handle].bucket.obj;
-
- if (!EG(objects_store).object_buckets[handle].valid) {
- zend_error(E_ERROR, "Trying to delete invalid object");
- }
-
-
- if (obj->dtor && !EG(objects_store).object_buckets[handle].destructor_called) {
- EG(objects_store).object_buckets[handle].destructor_called = 1;
- obj->dtor(obj->object, handle TSRMLS_CC);
- }
- EG(objects_store).object_buckets[handle].valid = 0;
-
-#if ZEND_DEBUG_OBJECTS
- fprintf(stderr, "Deleted object id #%d\n", handle);
-#endif
-
-}
-
#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST() \
EG(objects_store).object_buckets[handle].bucket.free_list.next = EG(objects_store).free_list_head; \
EG(objects_store).free_list_head = handle; \
ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC);
ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC);
-#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_delete_obj, zend_objects_store_clone_obj
+#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj
ZEND_API zval **zend_object_create_proxy(zval *object, zval *member TSRMLS_DC);