Please consider this case:
I am running same animation on different sprites, here it is how I am achieving it :-
CCSpriteBatchNode *animStarBatchNode=CCSpriteBatchNode::create(“animStar.png”,100);// no need to retain.
CCSprite *s=CCSprite::createWithSpriteFrameName;// no need to retain
CCSequenceseq = CCSequence::createWithTwoActions,CCCallFuncO::create,animStarBatchNode));
where “animation” used in sequence is created from CCAnimation and is declared outside above for loop, so as the loop goes on retain Count for animation increases depending on if condition there .
1> Do I need to worry about this count as I am not explicitly retaining it ?
2> or Should I refactor my code for avoiding such conditions ? where retain count keeps on increasing ?
3> In the call back function showSparklesFinished I am removing all children from the bacthNode animStarBatchNode and then removing animStarBatchNode from its parent (a layer )and as I am creating new batchNode every loop and sending them to the call back function so is it sure that every batchNode will be removed from its parent in the call back function one by one I am seeing possibility of memory leak.
Please share your thoughts
Similarly the retain count of “seq” object increases as its inside the for loop and added every time runAction is called.