in reply to Re^2: Storing object references internally
in thread Storing object references internally
One thing you can do, is use a weak reference in the common data structure. That way, it'll be wiped when the object goes away.
Weak references can be created using weaken() in Scalar::Util. Be sure to keep the vital link to your objects a strong reference (= not weakened), because if all you have left is weak references, the object will go away and all those references will become undef.
|
|---|