LoginSignup
13
13

More than 5 years have passed since last update.

Cocos2d-x CCAnimation メモリリーク

Posted at

下記の様なコードを書いた場合

// アニメーションフレームを管理するクラスを生成
CCAnimation *animation = CCAnimation::create();
animation->addSpriteFrameWithFileName(fileName->getCString());

そのSceneのデストラクタに2行追加しないとメモリリークします。
CCSpriteFrameCache::sharedSpriteFrameCache()->removeSpriteFrames();
CCTextureCache::sharedTextureCache()->removeUnusedTextures();

1時間くらいハマりました^^;

13
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13