Archive for the “Air” Category

codewow – how hard is it to stop memory leaks in AS3? Programming for FP10 AIR in Flex, I have a class that loads an image from the web by setting the source property on the image to a url.

I add and remove many instances of the class on the display list. I get lots of memory leakage. All my listeners are weakly referenced, I even remove the event listeners when I unload the class instances. I also delete everything I’ve created. Still memory leaks. It turns out, and it took a while to find this, that you need to “unloadAndStop(true)” on images you’ve loaded, then they get unloaded from memory. Now, no memory leaks.

There don’t seem to be many mentions of this, certainly one to watch out for if you’re having memory problems!

Comments 2 Comments »