RE: [PHP-DEV] Destruct order/What is reference counted?
| From: | Sam Liddicott | Date: | Tue, 30 Jan 2001 08:48:23 +0000 |
| Subject: | RE: [PHP-DEV] Destruct order/What is reference counted? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45315@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Sam Liddicott [mailto:sam.liddicott@ananova.com]
> Sent: Monday, January 29, 2001 05:22
> To: php-dev@lists.php.net
> Subject: [PHP-DEV] Destruct order/What is reference counted?
>
>
> Are resources refence counted, or variables?
>
> I have a muscat_module method I wrote which is of the form:
>
> $new_resource=make_new_object($old_resource);
>
> each resource is a C++ object, and I have to stop $old_resource being
> disposed of until $new_resource has also been disposed of.
To be more accurate, when old_resource is disposed of it will dispose of any
remaining underlying new_resource objects, leaving a load of invalid
new_resource's which will then be free'd later - unsuccessfully.
So I either need to preserve the life of the underlying old_resource until
all visible new_resources are finished, or find some way to mark the
remaining new_resources as invalid.
> It seems like there is no destroy order at end-of-page time?
> Whats the best way to enforce it?
>
> I think I am going to have to wrap all the C++ objects in more C++ to
> implement reference counting- aggh. Surely there is another way?
>
> Sam
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>