I'd say, keep the loader instance (instead of creating a new one each time) and unload the loader "content" (the swf) using Loader.unloadAndStop.
http://kb2.adobe.com/cps/403/kb403670.html

http://www.gskinner.com/blog/archives/2008/07/additional_info.html

regards,
Muzak

----- Original Message ----- From: "Gregory Boland" <breakfastcof...@gmail.com>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Friday, October 02, 2009 5:57 AM
Subject: Re: [Flashcoders] [MEMORY LEAK]


All I can say is that you aren't releasing all of the references to this
material that you are trying to release from memory.

So after you make this call

addChild(loadEvent.currentTarget.content);

make that = to null as well as any other time that you are referring to this
content you are trying to rid.

I know if you run your program in Flex Builder and choose the profiler, you
can actually purge the garbage manually and see if the object you want to be
deleted gets purged.  If it hasn't then there is still something that is
referencing it.  However, after looking at your code it seems that you are
writing it on the timeline and i'm not sure how you would go about putting
that into Flex Builder.

best of luck

greg

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to