Esempio n. 1
0
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;
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
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;
}