RE: [PHP-DEV] Destruct order/What is reference counted? From: Sam Liddicott (sam.liddicott <email protected>)
Date: 01/30/01

> -----Original Message-----
> From: Sam Liddicott [mailto:sam.liddicott <email protected>]
> Sent: Monday, January 29, 2001 05:22
> To: php-dev <email protected>
> 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 <email protected>
> For additional commands, e-mail: php-dev-help <email protected>
> To contact the list administrators, e-mail:
> php-list-admin <email protected>
>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>