iOS memory warning and leak

Hello, guys!

I’m test app on iOS platform (5s).

I created project with menu and game “view”. On Game view I show spritesheet animations (about 12, preloaded on start application). After closing game view, I remove all animations, but if l load this game view about 3-4 times, have a memory leak. But I remove all sprites after closing view.

For removing anims I’m use removeChild, child=null, remove all listeners and all links to children’s and game view, but it’s not helpful.

Spritesheets I kept on assets Library.

Please, help to decide this problem.

Thanks.

Assets uses an internal cache by default (so you can call Assets.getBitmapData (etc) over and over without worrying about performance of decoding each time)

Could you try dumping your Assets.cache, or perhaps you should use false when loading your images, so that it doesn’t store a reference there?

I tried to disable assets cache, but its not helpful. I keep my spritesheets on my AssetLibrary on StringMaps (about 12 sprite sheets), whence take animations by key.

For example: animations:StringMap<Spritesheet>,
For creatting I use: var anim = AssetLibrary.get(keyAnim);

I tried loading assets on launch application, and every time on loading my GameView (where show anims).

But the message “Memory warning” is shows after 2-3 loadings GameView, and “due to memory issue” on fourth show

Thanks, singmajesty, i solved this problem.

How did you solve it? :slight_smile: