Hi there,
in my custom scene I have an array of sprites. In my dealloc method I release that array, but the sprites are not really released if they are moving. To fix it I remove all of them in my onExit method.
I saw an old thread on google groups about that with a fix that released the target in the dealloc method of the Action class.
But it seems to be removed.
Does exist a better way to do that?
Thank you!
replacing scene while some actions are running
(7 posts) (2 voices)-
Posted 2 years ago #
-
what cocos2d version are you using ?
I think it works OK with v0.8-rcPosted 2 years ago # -
I'm using "0.8-beta - 17-Jun-2009". do I need an upgrade to the latest?
Posted 2 years ago # -
Yes, could you try with v0.8-rc.
Posted 2 years ago # -
Hi, I tried with the v0.8-rc but I have the same problem,but it works if I remove all the sprites in my onExit method.
Posted 2 years ago # -
Could you post the code to reproduce it ? Thanks.
I couldn't reproduce it doing my own test.Posted 2 years ago # -
Ok maybe I found. I have that problem only if I replace the scene during an action assigned to a sequence that has a CallFunc too.
This is the code I use, is it the right way to do that?IntervalAction *move = [MoveTo actionWithDuration:10 position:ccp(400, 100)];
id notify = [CallFunc actionWithTarget:self selector:@selector(onAnimationEnd)];
id seq = [Sequence actions:move, notify, nil];
[sprite runAction:seq];If I replace the scene before the 10 seconds, the sprite is not released, otherwise it's released successfully.
Posted 2 years ago #
Reply
You must log in to post.