@@ -50,9 +50,14 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects)
50
50
if (IS_OBJ_VALID (obj )) {
51
51
if (!(GC_FLAGS (obj ) & IS_OBJ_DESTRUCTOR_CALLED )) {
52
52
GC_FLAGS (obj ) |= IS_OBJ_DESTRUCTOR_CALLED ;
53
- GC_REFCOUNT (obj )++ ;
54
- obj -> handlers -> dtor_obj (obj );
55
- GC_REFCOUNT (obj )-- ;
53
+
54
+ if (obj -> handlers -> dtor_obj
55
+ && (obj -> handlers -> dtor_obj != zend_objects_destroy_object
56
+ || obj -> ce -> destructor )) {
57
+ GC_REFCOUNT (obj )++ ;
58
+ obj -> handlers -> dtor_obj (obj );
59
+ GC_REFCOUNT (obj )-- ;
60
+ }
56
61
}
57
62
}
58
63
}
@@ -149,17 +154,6 @@ ZEND_API void zend_objects_store_put(zend_object *object)
149
154
SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle], EG(objects_store).free_list_head); \
150
155
EG(objects_store).free_list_head = handle;
151
156
152
- ZEND_API void zend_objects_store_free (zend_object * object ) /* {{{ */
153
- {
154
- uint32_t handle = object -> handle ;
155
- void * ptr = ((char * )object ) - object -> handlers -> offset ;
156
-
157
- GC_REMOVE_FROM_BUFFER (object );
158
- efree (ptr );
159
- ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST (handle );
160
- }
161
- /* }}} */
162
-
163
157
ZEND_API void zend_objects_store_del (zend_object * object ) /* {{{ */
164
158
{
165
159
/* Make sure we hold a reference count during the destructor call
@@ -172,7 +166,9 @@ ZEND_API void zend_objects_store_del(zend_object *object) /* {{{ */
172
166
if (!(GC_FLAGS (object ) & IS_OBJ_DESTRUCTOR_CALLED )) {
173
167
GC_FLAGS (object ) |= IS_OBJ_DESTRUCTOR_CALLED ;
174
168
175
- if (object -> handlers -> dtor_obj ) {
169
+ if (object -> handlers -> dtor_obj
170
+ && (object -> handlers -> dtor_obj != zend_objects_destroy_object
171
+ || object -> ce -> destructor )) {
176
172
GC_REFCOUNT (object )++ ;
177
173
object -> handlers -> dtor_obj (object );
178
174
GC_REFCOUNT (object )-- ;
@@ -204,18 +200,6 @@ ZEND_API void zend_objects_store_del(zend_object *object) /* {{{ */
204
200
}
205
201
/* }}} */
206
202
207
- /* zend_object_store_set_object:
208
- * It is ONLY valid to call this function from within the constructor of an
209
- * overloaded object. Its purpose is to set the object pointer for the object
210
- * when you can't possibly know its value until you have parsed the arguments
211
- * from the constructor function. You MUST NOT use this function for any other
212
- * weird games, or call it at any other time after the object is constructed.
213
- * */
214
- ZEND_API void zend_object_store_set_object (zval * zobject , zend_object * object )
215
- {
216
- EG (objects_store ).object_buckets [Z_OBJ_HANDLE_P (zobject )] = object ;
217
- }
218
-
219
203
ZEND_API zend_object_handlers * zend_get_std_object_handlers (void )
220
204
{
221
205
return & std_object_handlers ;
0 commit comments