Without seeing any code, it will be difficult to answer correctly, but I'm going to risk a guess or two. Hope this helps.
A common mistake is not to use the ::create() functions, which all related Node classes have by default. Using ::create() , make sure that Ref used, which means that the object will be counted by reference, and the memory will automatically be freed after replacing the scene. Therefore, if you use new Scene() somewhere in your code (and you do not release it in the destructor) instead of Scene::create() , you will have a memory leak right there.
The same can be said about Sprite , Node , Action , basically anything. Always use the associated static function ::create() . If you have inherited from any of these classes, you can easily create your own create() method by placing CREATE_FUNC(Player) in the class definition in the header. In this case, Player is the name of the class you created that extends an existing class, such as Node or Sprite .
RadicalRaid
source share