Messaging and Memory Management

Apr 24, 2010 at 10:27 PM

Does mvvm-light handle memory ok?  Specifically, if I register or subscribe to a message from within an instance, and that instance gets dropped from memory (and doesnt have a chance to unregister or unscubscribe)... what about the reference the messaging system had?  Does it get removed?  Or will it build up a memory leak?

Apr 25, 2010 at 11:03 AM


All the recipients who subscribed to receive a message through the Messenger are weak-referenced. I recommend unregistering if you can, in order to have a cleaner process,  but if you forget or don't have the possibility to unregister, the instances will be garbage collected anyway and do not cause a memory leak.