in reply to Re: Re: Re: Re: explicitly calling destructor
in thread explicitly calling destructor

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.

I think you may have missed the point of diotalevi's code. The DESTROY method checks the pre-destruct flag itself, and bails if it's been set, so there's no need for you to check the flag in every method.

cheers,

J

  • Comment on Re: Re: Re: Re: Re: explicitly calling destructor

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: explicitly calling destructor
by diotalevi (Canon) on May 16, 2003 at 13:35 UTC

    I think you missed the point of doing the check in the other methods. I briefly thought about zeroing the contents of the object but decided not to for simplicity in this case. There's general utility in preventing other methods which might expect the object to still work from actually working. But if that happens then something is seriously wrong so its ok to throw a fatal error.

      I think I missed the point of which methods we were talking about. 8)

      (I was thinking of the methods that were explicitly calling the DESTROY method.)