diff --git a/tests/tests/ActionsTest/ActionsTest.cpp b/tests/tests/ActionsTest/ActionsTest.cpp index cb34947a76..049c8de079 100644 --- a/tests/tests/ActionsTest/ActionsTest.cpp +++ b/tests/tests/ActionsTest/ActionsTest.cpp @@ -850,7 +850,7 @@ void ActionCallFuncND::onEnter() centerSprites(1); CCFiniteTimeAction* action = CCSequence::actions(CCMoveBy::actionWithDuration(2.0f, ccp(200,0)), - //CCCallFuncND::actionWithTarget(m_grossini, callfuncND_selector(ActionCallFuncND::removeFromParentAndCleanup), (void*)true), + CCCallFuncND::actionWithTarget(this, callfuncND_selector(ActionCallFuncND::removeFromParentAndCleanup), (void*)true), NULL); m_grossini->runAction(action); @@ -866,6 +866,12 @@ std::string ActionCallFuncND::subtitle() return "CallFuncND + removeFromParentAndCleanup. Grossini dissapears in 2s"; } +void ActionCallFuncND::removeFromParentAndCleanup(CCNode* pSender, void* data) +{ + bool bCleanUp = (bool)data; + m_grossini->removeFromParentAndCleanup(bCleanUp); +} + //------------------------------------------------------------------ // // ActionSpawn diff --git a/tests/tests/ActionsTest/ActionsTest.h b/tests/tests/ActionsTest/ActionsTest.h index 686a0b22dc..fd495b653e 100644 --- a/tests/tests/ActionsTest/ActionsTest.h +++ b/tests/tests/ActionsTest/ActionsTest.h @@ -265,6 +265,7 @@ public: virtual void onEnter(); virtual std::string title(); virtual std::string subtitle(); + void removeFromParentAndCleanup(CCNode* pSender, void* data); }; class ActionFollow : public ActionsDemo