Re: New destructors implementation
| From: | Michael Walter | Date: | Sat, 07 Feb 2004 11:36:56 +0000 |
| Subject: | Re: New destructors implementation | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-7640@lists.php.net to get a copy of this message | ||
Zeev Suraski wrote:
At 00:58 07/02/2004, Christian Jerono wrote:Cheers, MichaelWell so wouldn't 'reverse construction order' mean: $container=...; $obj = $container->getFoo(); results in call of $obj->__destruct(); and then $container->__destruct(); maybe i just missed the problem here?Yes, and yes you did :) The whole problem is if $container needs to use Foo, its element, during destruction. Well, the $obj reference would be "freed" first (--refcount), then all left would be $container (which still holds a reference to its $m_foo data member). Without having circular references and stuff, it should be possible to clean up the data members of a particular instance after the corresponding destructor call, I suppose.