CCCallLambda * CCCallLambda::create(boost::function<void ()> lambda) { CCCallLambda *pRet = new CCCallLambda(); if (pRet && pRet->initWithTarget(lambda)) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }
CCObject * CCCallLambda::copyWithZone(CCZone *pZone) { CCZone* pNewZone = NULL; CCCallLambda* pRet = NULL; if (pZone && pZone->m_pCopyObject) { //in case of being called at sub class pRet = (CCCallLambda*) (pZone->m_pCopyObject); } else { pRet = new CCCallLambda(); pZone = pNewZone = new CCZone(pRet); } CCActionInstant::copyWithZone(pZone); pRet->initWithTarget(mLambda); CC_SAFE_DELETE(pNewZone); return pRet; }