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::PauseResumeActions()
|
||||||
|
: m_pPausedTargets(NULL)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
PauseResumeActions::~PauseResumeActions()
|
||||||
|
{
|
||||||
|
CC_SAFE_RELEASE(m_pPausedTargets);
|
||||||
|
}
|
||||||
|
|
||||||
void PauseResumeActions::onEnter()
|
void PauseResumeActions::onEnter()
|
||||||
{
|
{
|
||||||
ActionsDemo::onEnter();
|
ActionsDemo::onEnter();
|
||||||
|
@ -1656,12 +1668,15 @@ void PauseResumeActions::pause(float dt)
|
||||||
{
|
{
|
||||||
CCLog("Pausing");
|
CCLog("Pausing");
|
||||||
CCDirector *director = CCDirector::sharedDirector();
|
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)
|
void PauseResumeActions::resume(float dt)
|
||||||
{
|
{
|
||||||
CCLog("Resuming");
|
CCLog("Resuming");
|
||||||
CCDirector *director = CCDirector::sharedDirector();
|
CCDirector *director = CCDirector::sharedDirector();
|
||||||
director->getActionManager()->resumeTargets(this->m_pPausedTargets);
|
director->getActionManager()->resumeTargets(m_pPausedTargets);
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,6 +367,8 @@ private:
|
||||||
class PauseResumeActions : public ActionsDemo
|
class PauseResumeActions : public ActionsDemo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
PauseResumeActions();
|
||||||
|
virtual ~PauseResumeActions();
|
||||||
virtual void onEnter();
|
virtual void onEnter();
|
||||||
virtual std::string subtitle();
|
virtual std::string subtitle();
|
||||||
virtual std::string title();
|
virtual std::string title();
|
||||||
|
|
Loading…
Reference in New Issue