I am actually using the Loader Class to get an image from a distante server. I am using it for is job and when it's done I remove it from memory but there is a little leak.
To see it, I am using scout. In the memory part, the Bitmap DisplayObjects is free but the Images part is not.
When I look at the scout documentation, I found that the Images part is the compressed version of the files I am loading.
What should I do to free this part of the memory?
thanks
edit 2(forget the _ before loader): Here is what I did to free the Loader :
(_loader.content as Bitmap).bitmapData.dispose();
_loader.unload();
this.removeChild(_loader);
_loader = null;
edit 3 : I still need help for my memory leaks, thanks
It's very easy to have a memory leak when using the Loader class. For the garbage collector to remove an object from the memory following rules must apply:
Here's a small example of using the Loader
Looks pretty simple, doesn't it? ;) I did not include the handler, since it's not important for this example.
Now let's remove it:
Now the loader should be removed from the memory on the next garbage collector run. Just make sure you've cleared all the listeners and references.
Hope that helps!