When you call unload on a ModuleInfo, you are just releasing one
reference to it.  There's no practical way for us to keep track of all
references to things in a module and go clean them up.  However, while I
suppose it is the "safe" approach to clean everything, you might be
better served knowing what things to clean.  It makes it clearer what
the connections are between modules and forces you to have a cleaner
architecture in order to minimize the number of connection points.
 
Note also that event listeners are "backwards".
someObj.addEventListener("event", myEvent) doesn't make an additional
reference to someObj, it makes a reference from someObj to the owner of
myEvent.
 
-Alex

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of kyle.vanvranken
Sent: Thursday, April 19, 2007 8:26 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Module GC question



So it would be best to remove all listeners that you can and set every
var the module is using to null before unloading it to get that memory
back.

That's definitely doable I'm just surprised that unloading the module
doesn't wipe out all those references. Thanks for the quick reply Alex!



 

Reply via email to