diff options
Diffstat (limited to 'Zend/zend_closures.c')
-rw-r--r-- | Zend/zend_closures.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 452f99e6fb..f1ffe78c69 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -486,10 +486,9 @@ static void zend_closure_free_storage(zend_object *object) /* {{{ */ zend_object_std_dtor(&closure->std); if (closure->func.type == ZEND_USER_FUNCTION) { - /* We shared static_variables with the original function. - * Unshare now so we don't try to destroy them. */ - if (closure->func.op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE) { - ZEND_MAP_PTR_INIT(closure->func.op_array.static_variables_ptr, NULL); + /* We don't own the static variables of fake closures. */ + if (!(closure->func.op_array.fn_flags & ZEND_ACC_FAKE_CLOSURE)) { + zend_destroy_static_vars(&closure->func.op_array); } destroy_op_array(&closure->func.op_array); } |