mirror of https://github.com/axmolengine/axmol.git
1. fixes ActionManagerEx crashes.
This commit is contained in:
parent
30f4a5cced
commit
24d87ad05b
|
@ -42,7 +42,12 @@ ActionManagerEx* ActionManagerEx::getInstance()
|
|||
|
||||
void ActionManagerEx::destroyInstance()
|
||||
{
|
||||
CC_SAFE_DELETE(sharedActionManager);
|
||||
if(sharedActionManager != nullptr)
|
||||
{
|
||||
sharedActionManager->releaseActions();
|
||||
CC_SAFE_DELETE(sharedActionManager);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ActionManagerEx::ActionManagerEx()
|
||||
|
@ -154,6 +159,13 @@ void ActionManagerEx::releaseActions()
|
|||
for (iter = _actionDic.begin(); iter != _actionDic.end(); iter++)
|
||||
{
|
||||
cocos2d::Vector<ActionObject*> objList = iter->second;
|
||||
int listCount = objList.size();
|
||||
for (int i = 0; i < listCount; i++) {
|
||||
ActionObject* action = objList.at(i);
|
||||
if (action != nullptr) {
|
||||
action->stop();
|
||||
}
|
||||
}
|
||||
objList.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -277,6 +277,7 @@ cocos2d::Node* LoadSceneEdtiorFileTest::createGameScene()
|
|||
{
|
||||
_filePath = "scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; //default is json
|
||||
_rootNode = SceneReader::getInstance()->createNodeWithSceneFile(_filePath.c_str());
|
||||
ActionManagerEx::getInstance()->playActionByName("startMenu_1.json", "Animation1");
|
||||
if (_rootNode == nullptr)
|
||||
{
|
||||
return nullptr;
|
||||
|
|
Loading…
Reference in New Issue