Garbage Collection!

Ok, so after using the Profiler perspective in flex, I’ve been scared to death of memory leaks. Top on my list of things to do is to find a fix. I have an idea that could work, but definitely needs a better approach. If anyone knows of some rare, help methods that could turn this into something, please let me know.

So I just found out about the flash.utils.describeType function that retrieves a list of everything about an object. I use it to find all the variables I’ll be nulling when I want to erase an object for garbage collection. I have a function “destroy” that will run a loop that sets all of the non-number variables to null before removing the child. Now, is there a function that I could use instead of running a loop?–it’s a bit CPU intensive. also, because I’m using something like Child[“variable”] = null; to nullify a property, it won’t work with private variables. the thing is, the memory is next to nothing whenever I have the destroy function working whenever I want to get rid of something, but I can tell there’s a bit of lagging.

anything will help. thanks.

(i’m sure senocular will quickly refer me to one of his posts I’ve overlooked ;))