Hi all,
I too am having this problem. Currently, I have 6 animated AtlasSprites in my game scene, each in a fixed position, running a RepeatForever animation.
When my game scene is not needed anymore, I call stopAllActions on each of my AtlasSprites and, for some reason, the retainCount on the AtlasSprites does not always decrease, causing the AtlasSprite to be leaked. Curiously, the retainCount does usually decrease properly (on an average run, only 1 of my 6 AtlasSprites does not release properly), and if I check the numberOfRunningActions, it always returns 0 after calling stopAllActions (even in cases where the retainCount did not decrease)...
Hope this description makes sense, this has been driving me mad for two evenings now.
Sajjad, did you find a solution to this problem?
Anyone have any ideas as to why this is happening? (I am using cocos2d 0.8.1).
Here is my animation action code (self is a subclass of AtlasSprite):
AtlasAnimation *testAnimation = [AtlasAnimation animationWithName: @"test" delay: 0.05];
[testAnimation addFrameWithRect: CGRectMake(32 * 0, 270, 32, 37)];
[testAnimation addFrameWithRect: CGRectMake(32 * 1, 270, 32, 37)];
[testAnimation addFrameWithRect: CGRectMake(32 * 2, 270, 32, 37)];
[testAnimation addFrameWithRect: CGRectMake(32 * 3, 270, 32, 37)];
[[ActionManager sharedManager] addAction: [RepeatForever actionWithAction: [Animate actionWithAnimation: testAnimation restoreOriginalFrame: NO]] target: self paused: NO];
Thanks in advance,
Mike