From 14af1fe6923c65a91cd77eab5a8d4326f854391d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 22 Mar 2012 14:38:38 +0400 Subject: [PATCH] Fixed reference counting --- ext/spl/spl_directory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index fb198236e5..9d454c94bb 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -1644,8 +1644,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; } @@ -1847,8 +1847,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; } -- 2.40.0