Automatic resource deallocation fails
| From: | Till Gerken | Date: | Thu, 16 Mar 2000 15:04:32 +0000 |
| Subject: | Automatic resource deallocation fails | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12240@lists.php.net to get a copy of this message | ||
Hello,
I am trying to make use of automatic resource deallocation. Registering a
destructor for a resource is no problem, doing
zend_list_insert()
zend_list_delete()
will properly call the destructor.
However, when I assign the resource value to a pval container and pass it
back as return value from a function, as soon as all references to this pval
container are lost (calling unset() on the variable, overwriting it with
different values etc.), the destructor is not being called.
Am I required to decrease the reference count manually somewhere?
Till