Projects > cpp > Issues > Bug #3264

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

CCTargetedAction executes callback twice

Bug #3264 [Closed]
magiceye 2013-11-22 07:19 . Updated about 10 years ago

CCLayer::init() {

CCSprite* r = CCSprite::create(“xxx”);
this~~>addChild;
CCSprite* e = CCSprite::create;
this~~>runAction(CCTargetedAction::create(e, CCCallFuncN::create(r, callfuncN_selector(CCSprite::addChild)))); // CCSprite::addChild will be called twice
e->runAction(CCCallFuncN::create(r, callfuncN_selector(CCSprite::addChild))); // ok
}

CCTargetedAction will make “r->addChild(e)” called twice, then CCAssert will fail.

refer: http://cocos2d-x.org/forums/6/topics/39546

walzer@cocos2d-x.org 2014-10-08 02:45

Redmine issue system is closed, we are using github issue system instead.

This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8262

Atom PDF

Status:Closed
Start date:2013-11-22
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:all
Target version:-