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; }