]> granicus.if.org Git - php/commitdiff
- Refcounting
authorMarcus Boerger <helly@php.net>
Sat, 27 Jan 2007 22:23:52 +0000 (22:23 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 27 Jan 2007 22:23:52 +0000 (22:23 +0000)
ext/phar/phar.c

index 6b5c8dabc3b2bcd6464ca26e768764a59597a782..5ca6b87d8e6f7ca116091ee73fad62126d341262 100644 (file)
@@ -401,6 +401,7 @@ void phar_entry_remove(phar_entry_data *idata TSRMLS_DC) /* {{{ */
                        php_stream_close(idata->fp);
                }
                zend_hash_del(&idata->phar->manifest, idata->internal_file->filename, idata->internal_file->filename_len);
+               idata->phar->refcount--;
                efree(idata);
        } else {
                idata->internal_file->is_deleted = 1;
@@ -2521,8 +2522,6 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, char *url, int optio
                php_url_free(resource);
                return FAILURE;
        }
-       /* faulty increment of phar refcount - nothing persists beyond this function */
-       idata->phar->refcount--;
        if (idata->internal_file->fp_refcount > 1) {
                /* more than just our fp resource is open for this file */ 
                php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, resource->host);