From: Dmitry Stogov Date: Thu, 22 Mar 2012 10:38:38 +0000 (+0400) Subject: Fixed reference counting X-Git-Tag: php-5.5.0alpha1~411^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5bf1efbf209b7d14edc8d01098465ed0bdda1516;p=php Fixed reference counting --- diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index c6eec945e9..7bd340b403 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1655,8 +1655,8 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval /* ->current must be initialized; rewind doesn't set it and valid * doesn't check whether it's set */ iterator->current = object; + Z_SET_REFCOUNT_P(object, Z_REFCOUNT_P(object) + 2); } - zval_add_ref(&object); return (zend_object_iterator*)iterator; } @@ -1858,8 +1858,8 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva if (iterator->intern.data == NULL) { iterator->intern.data = object; iterator->intern.funcs = &spl_filesystem_tree_it_funcs; + zval_add_ref(&object); } - zval_add_ref(&object); return (zend_object_iterator*)iterator; }