Problems? Is your data what you think it is? | |
PerlMonks |
explicitly calling destructorby mla (Beadle) |
on May 15, 2003 at 22:41 UTC ( [id://258535]=perlquestion: print w/replies, xml ) | Need Help?? |
mla has asked for the wisdom of the Perl Monks concerning the following question: I have an object that locks a resource and releases it on destruction. This is under mod_perl, and the object should be destroyed at the end of every request. Unfortunately, a reference to the object is being maintained somewhere, I'm not sure where, which is preventing destruction and keeping the resource locked. I need to locate those extra references, but as a short-term solution, I'd like to make sure the lock is released. I could call the DESTROY method explicity, which would release the lock. But then, I want to make certain that DESTROY is not called again, implicitly, if/when the object is really reclaimed, since the lock will have already been released, making it unsafe. If I reblessed the object into a null class, it seems like I'd be okay. Here's some example code. Does that make sense? Is there a better solution? Thank you.
Back to
Seekers of Perl Wisdom
|
|