From: Dmitry Stogov Date: Thu, 22 Mar 2012 11:51:33 +0000 (+0400) Subject: Revert "Fixed reference counting" X-Git-Tag: php-5.5.0alpha1~411^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f49678fd82913b9aefbf6bf492e6017d4ba14bd;p=php Revert "Fixed reference counting" This reverts commit 5bf1efbf209b7d14edc8d01098465ed0bdda1516. --- diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 7bd340b403..c6eec945e9 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; }