Hi,
I was wondering if there is any way in a __del__ method to know when it's
invoked on the way out, as a result of the program going away?
I have a __del__ method of a class that sends a message to a global variable.
It happens that on the way out, that value in that variable is destroyed before
the __del__ methods of my instances are invoked. The result is that I have a
bogus value that doesn't respond to the usual methods anymore. How can I
prevent sending messages to that object?
A possible solution would be to use atexit() but this doesn't work if the user
program that's using my library replaces it with its own function.
Any ideas?
Thanks,
--
Ovidiu Predescu <ovidiu@cup.hp.com>
http://andromeda.cup.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/
I was wondering if there is any way in a __del__ method to know when it's
invoked on the way out, as a result of the program going away?
I have a __del__ method of a class that sends a message to a global variable.
It happens that on the way out, that value in that variable is destroyed before
the __del__ methods of my instances are invoked. The result is that I have a
bogus value that doesn't respond to the usual methods anymore. How can I
prevent sending messages to that object?
A possible solution would be to use atexit() but this doesn't work if the user
program that's using my library replaces it with its own function.
Any ideas?
Thanks,
--
Ovidiu Predescu <ovidiu@cup.hp.com>
http://andromeda.cup.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/