Navigation
Subscribe
More About This Website


Twitter Status
:



« Simple Variable Naming Prefix(s) | Main | Save State Web Browsers »
Friday
18Apr

the Dictionary, and Weak References.

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

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>