Can I tell if I am out of scope?
<p>Is there any way I can tell, from the inside of the object, whether I am out of scope?</p>

<p>I have an object that must be closed. If it is not closed then a leak is guaranteed. I would like to try to auto-close if possible.</p>

<p>One of my private instance variables is a thread that must be shut down during the close. I am guessing the existence of the thread will cause unclosed objects to never be gc'd.</p>

<p>Paul</p>
