So I used the LocalConnection hack to force GC to run, and it cleaned up the object. I was not aware that GC might not run because there isn't enough of a reason to. If I had put this code into a fairly large application, GC would have more of a reason to run and thus probably end up cleaning up that object right?
Ktu Lesson learned: You must remove all event listeners yourself. On Sat, Nov 7, 2009 at 12:36 PM, Henrik Andersson <he...@henke37.cjb.net>wrote: > Ktu wrote: > >> That is true, however, this eventListener fires indefinitely. Garbage >> collection should pick it up after 30 seconds right? >> I have tried this on the main timeline, and in a document class, but GC >> never cleans up the object. Why? >> >> > There is no set time when it will run. It runs when Flash thinks that it > would be a good idea. The exact time is left intentionally unspecified so > that they can change their minds if needed. There isn't even a guarantee > that garbage collection will ever collect eligible objects. > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders