]> granicus.if.org Git - php/commitdiff
- No need to keep object alive, iterator api is taking care of that already
authorMarcus Boerger <helly@php.net>
Sat, 20 May 2006 18:48:43 +0000 (18:48 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 20 May 2006 18:48:43 +0000 (18:48 +0000)
ext/spl/spl_iterators.c

index 8d05806df28a2ae2d6fd612fcb1b7f83c2afcb65..5d13cd2fc1884a9391156d20f3312a1a7844ee39 100755 (executable)
@@ -2405,7 +2405,6 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v
 {
        zend_object_iterator   *iter;
 
-       obj->refcount++;
        iter = Z_OBJCE_P(obj)->get_iterator(Z_OBJCE_P(obj), obj, 0 TSRMLS_CC);
 
        if (EG(exception)) {
@@ -2434,9 +2433,6 @@ PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, v
 
 done:
        iter->funcs->dtor(iter TSRMLS_CC);
-       if (obj->refcount > 0 && !EG(exception)) {
-               zval_ptr_dtor(&obj);
-       }
        return EG(exception) ? FAILURE : SUCCESS;
 }
 /* }}} */