user1169079
user1169079

Reputation: 3083

What all to take care about for memory leak in cocos2d-x?

Hello I want to know what all I should take care about for memory leak in cocos2d-x. I am taking care of all the objects created by me i.e. using core C++ but how to take care or manage the code in cocos2d-x to avoid memory leak ?

What about actions,sprites and all ? Please give me reason also so it will be better for me to understand

Thanks

Upvotes: 1

Views: 1010

Answers (1)

m.ding
m.ding

Reputation: 3182

  1. try to use the cocos2d-x static function instead of new CLASS_NAME(), since all the static create function is autorelease() and you don't need to take care of it.

  2. if you are not sure what you are doing, make sure every instance is a subclass of CCObject, and whenever when you call a new Class(), remember to call release().

Upvotes: 1

Related Questions