Memory Management Issues

Memory Management Issues
0.0 0


I’m in the latter stages of my cocos2d-x game project and I’ve run into what could be a HUGE issue in the form of memory management.

I have 5 sprites sheets in my game (fps_images.png, my font, my front end texture, my in game HUD texture and my in game sprites texture) I don’t need all these textures in memory all the time for obvious reasons and it could cause issues after prolonged play. I tried using CCTextureCache::shareTextureCache()->removeUnusedTextures(); but it didnt remove any textures.

This confused me, but as it turns out as I move between scenes in my game, the scenes are not being deleted (neither the class destructor or release method are called) and I have no idea why.

Can someone point me in the right direction or tell me how to explicitly release the scenes after I’m finished using them?