I have a MainMenuScene and a GameScene...
In the MainMenu I have the button start that goes to the GameScene, in the middle of the game I want to restart or just quit the game, which ever of those 2 that I do, when I replace the GameScene with another GameScene or just go back to the mainmenu and then back to a new GameScene again, the FPS starts dropping and dropping, if I do that cycle 1 time the FPS drops from 60 to 30, if I do it once again the FPS drops to 15, and so on and so on...
I believed that the problem was the memory leak because I left the scene alive... but its not I have checked and checked, and there is no strong reference to that scene anywhere, and also its ARC enabled, I checked with Instruments profile and nothing there is no memory leak according to instruments from Xcode.
Has anyone has had this issue... or anyone has any idea what might I be doing wrong? according to what I have read in ReplaceScene method from CCDirector that scene is destroyed and replaced with the new one, so there shouldn't be a problem.
==
Forgot to mention:
I have a weak reference of the GameLayer and the GameScene in a Singleton, However when I replace the scene, immediately after that I set those 2 nil, even though I shouldn't because they are weak reference but I do it just in case.
Adding Image for more context:
With the image above you can see that every time that ReplaceScene from CCDirector is called, the scenes, specifically the GameScenes, are getting deallocated. So memory leaks its not the problem, but it seems like the scenes are not getting destroyed, or thats my thinking, because the FPS just keeps dropping and dropping everytime.
... Few replacescenes later...
The strange thing here is that the MainMenu is not being affected AT ALL, the rendering time is the same... the draw calls are the same(that is understandable, even in the GameScene the drawCalls stay the same.) but in the GameScene the FPS keeps dropping, and the Rendering time is becoming HUGE, which is why the game becomes incredibly slow.
Will keep checking.