Friday
18Apr
the Dictionary, and Weak References.
Friday, April 18, 2008 at 01:43AM I was trying to figure out some sort of IoC type control to force unlinking of all external items referencing item B when item B was about to be deconstructed and marked for recycling. Then it hit me, all I have to do is make sure the referencing ( the Signal/Slot system ) was using Weak References. Therefore, by design, when the only reference to item B exists is in a Weak Reference in a Dictionary, it will still be gc'd and how the signal/slot is setup the gc process actually unlinks all the event handlers automatically since they are, themselves, bound to the instance.
Now that I have it written, I've got to test it.. now how do I go about that -- Uggh.
Reader Comments