mirror of https://github.com/axmolengine/axmol.git
fixed #1386: PauseResumeActionsTest crashes.
This commit is contained in:
parent
221d06509a
commit
e7d7ff99c7
|
@ -1628,6 +1628,18 @@ string ActionCardinalSpline::subtitle()
|
|||
|
||||
/** PauseResumeActions
|
||||
*/
|
||||
|
||||
PauseResumeActions::PauseResumeActions()
|
||||
: m_pPausedTargets(NULL)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PauseResumeActions::~PauseResumeActions()
|
||||
{
|
||||
CC_SAFE_RELEASE(m_pPausedTargets);
|
||||
}
|
||||
|
||||
void PauseResumeActions::onEnter()
|
||||
{
|
||||
ActionsDemo::onEnter();
|
||||
|
@ -1656,12 +1668,15 @@ void PauseResumeActions::pause(float dt)
|
|||
{
|
||||
CCLog("Pausing");
|
||||
CCDirector *director = CCDirector::sharedDirector();
|
||||
this->m_pPausedTargets = director->getActionManager()->pauseAllRunningActions();
|
||||
|
||||
CC_SAFE_RELEASE(m_pPausedTargets);
|
||||
m_pPausedTargets = director->getActionManager()->pauseAllRunningActions();
|
||||
CC_SAFE_RETAIN(m_pPausedTargets);
|
||||
}
|
||||
|
||||
void PauseResumeActions::resume(float dt)
|
||||
{
|
||||
CCLog("Resuming");
|
||||
CCDirector *director = CCDirector::sharedDirector();
|
||||
director->getActionManager()->resumeTargets(this->m_pPausedTargets);
|
||||
director->getActionManager()->resumeTargets(m_pPausedTargets);
|
||||
}
|
||||
|
|
|
@ -367,6 +367,8 @@ private:
|
|||
class PauseResumeActions : public ActionsDemo
|
||||
{
|
||||
public:
|
||||
PauseResumeActions();
|
||||
virtual ~PauseResumeActions();
|
||||
virtual void onEnter();
|
||||
virtual std::string subtitle();
|
||||
virtual std::string title();
|
||||
|
|
Loading…
Reference in New Issue