in reply to Catching an object going out of scope
The problem is how do you destroy this object later... I guess you can't, because you no longer have references to it (it went out of scope).
The answer to this last point, would be to keep a weak reference to the object. You should have good enough reasons to outweight the general ickiness in doing this tough :)
You could then have a custom function that destroys the circular reference and then destroys the weak reference. At this stage, the garbage collector can reclaim your object's space as it went completely out of scope.
Hope this helps.
|
|---|