EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate) { EaseRateAction *easeRateAction = new (std::nothrow) EaseRateAction(); if (easeRateAction && easeRateAction->initWithAction(action, rate)) { easeRateAction->autorelease(); return easeRateAction; } delete easeRateAction; return nullptr; }
EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate) { CCASSERT(action != nullptr, "action cannot be nullptr!"); EaseRateAction *easeRateAction = new (std::nothrow) EaseRateAction(); if (easeRateAction && easeRateAction->initWithAction(action, rate)) { easeRateAction->autorelease(); return easeRateAction; } CC_SAFE_DELETE(easeRateAction); return nullptr; }
EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate) { EaseRateAction *easeRateAction = new (std::nothrow) EaseRateAction(); if (easeRateAction) { if (easeRateAction->initWithAction(action, rate)) { easeRateAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(easeRateAction); } } return easeRateAction; }