Пример #1
0
ReuseGrid* ReuseGrid::create(int times)
{
    ReuseGrid *action = new (std::nothrow) ReuseGrid();
    if (action && action->initWithTimes(times))
    {
        action->autorelease();
        return action;
    }

    delete action;
    return nullptr;
}
Пример #2
0
ReuseGrid* ReuseGrid::create(int times)
{
    ReuseGrid *action = new (std::nothrow) ReuseGrid();
    if (action)
    {
        if (action->initWithTimes(times))
        {
            action->autorelease();
        }
        else
        {
            CC_SAFE_DELETE(action);
        }
    }

    return action;
}