return;
}
- /* Free object contents, but don't free objects themselves, so they show up as leaks */
+ /* Free object contents, but don't free objects themselves, so they show up as leaks.
+ * Also add a ref to all objects, so the object can't be freed by something else later. */
end = objects->object_buckets + 1;
obj_ptr = objects->object_buckets + objects->top;
if (obj->handlers->free_obj != zend_object_std_dtor) {
GC_ADDREF(obj);
obj->handlers->free_obj(obj);
- GC_DELREF(obj);
}
}
}
GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED);
GC_ADDREF(obj);
obj->handlers->free_obj(obj);
- GC_DELREF(obj);
}
}
} while (obj_ptr != end);