So after struggling with a memory leak pertaining to the loading of multiple modules and references hanging about after unloading said modules I am curious how others are dealing with the situation. I know there must be others out there loading up multiple modules in widget-like fashion. The example that comes to mind was a Portal app that loaded various widgets into it. Unfortunately the only examples I've found online use very simple UI based modules. I understand that weak references are the key I just seem to be unable to come up with a good solution.
To those of you out there using modules that a do more than display a UI component how are you managing the loading/unloading and destruction of the modules loaded?