in reply to Re: Re: Re: explicitly calling destructor
in thread explicitly calling destructor
But having a separate clean_up() method would work exactly the same way. Calling it would release the lock. But then, I'd want to make certain it wasn't called again (from DESTROY), if/when the object is really reclaimed, since the lock would have already been released, making it unsafe.
So I'd still need to either add a pre-destruct flag and check it in every method, as suggested, or use my hack of reblessing to a null class.
In the general case, I agree with you, of course. If you want to provide a clean-up method through your interface, then certainly don't call it DESTROY. But in this specific case, I'm really trying to fake destruction for an interface that relies on normal destruction, but which is currently borken due to my dangling references. And so in this case, I still don't see the win.
I understand the magic and am bending it to my will :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: explicitly calling destructor
by edoc (Chaplain) on May 16, 2003 at 13:30 UTC | |
by diotalevi (Canon) on May 16, 2003 at 13:35 UTC | |
by edoc (Chaplain) on May 16, 2003 at 13:48 UTC | |
|
Re: Re: Re: Re: Re: explicitly calling destructor
by LanceDeeply (Chaplain) on May 16, 2003 at 18:09 UTC |