Removing loaded external swf doesn't decrease memory
I am developing desktop application using flash builder 4.7, where I am loading external swf from main swf, but after removing it, it stays in processes, (checking in task manager. os: windows 7), process decreases a little bit, but not as much as it should be. so every time I load it again and remove, process increases and after multiple load, application crushes down. I am removing it like this
if (_loader.numChildren>0)
_loader.removeChildren(0,_loader.numChildren-1);
_loader.unload();
_loader.stopAllMovieClips();
_loader.unloadAndStop(true);
_loader.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);
this.removeChild(_loader);
_loader = null;
I added custom destroy method inside external swf and started calling it. I was removing nearly everything, (nearly saying because it could be something that I've missed, because it's huge project) but still the process remaind same.
Than I created empty swf (new project with no code and nothing in it) and tried to embed it and see what happens. It was all the same...
Then I thought new Air SDK could have fixed this problem, so I updated SDK to 19.0.0.207 currently latest, but still nothing, even though now the process increases higher.
I think it's Flash's gc issue. One of the solution is that to have one and only instance of external swf and removeChild and addChild it everytime you need it. It is kind of bad way to do so. Processes wont increase all the time, but in my case I have many swfs to load and it will slow down my application and for low RAM resource computers it may crush, and It's bad to have unnecessary thing running in background process
so any suggestions are welcome
