What the correct way to release CCFollow?

What the correct way to release CCFollow?
0.0 0


I have code like this:

schedule( schedule_selector(StageOne::updateCamera), 1.0f );

void StageOne::updateCamera(ccTime dt)
    CCFollow* pFollowA = CCFollow::actionWithTarget(pSprite, CCRect::CCRect(0.0f,0.0f, STAGE_HEIGHT, STAGE_WIDTH));

is memory leaked.

I guess, to fix it I should call something like this pFollowA->release() (after pFollowA end) with callback.
What the correct way to release CCFollow?


pFollowA is created by the static method, which has invoked obj~~>autorelease in it.
So pFollowA will be released after the action done, you don’t need to do anything more.
Perhaps you must call
bq. this~~>stopAllActions()

at the start of updateCamera(ccTime), do this to prevent too much actions binded to the same node in CCActionManager. Please try this approach.


Many thanks.

this works, memory don’t leak now.

May be this bug or bug in marmalade version?


No, it’s “design as this”.