CallFunc * CallFunc::create(const std::function<void()> &func) { CallFunc *ret = new (std::nothrow) CallFunc(); if (ret && ret->initWithFunction(func) ) { ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
CallFunc * CallFunc::create(const std::function<void()> &func) { CallFunc *pRet = new CallFunc(); if (pRet && pRet->initWithFunction(func) ) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }
CallFunc * CallFunc::create(Ref* selectorTarget, SEL_CallFunc selector) { CallFunc *ret = new (std::nothrow) CallFunc(); if (ret && ret->initWithTarget(selectorTarget)) { ret->_callFunc = selector; ret->autorelease(); return ret; } CC_SAFE_DELETE(ret); return nullptr; }
CallFunc * CallFunc::create(Object* selectorTarget, SEL_CallFunc selector) { CallFunc *pRet = new CallFunc(); if (pRet && pRet->initWithTarget(selectorTarget)) { pRet->_callFunc = selector; pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet); return NULL; }