mirror of https://github.com/axmolengine/axmol.git
Fixing armature test crash.
This commit is contained in:
parent
aaf4a6a81b
commit
513237d5f6
|
@ -46,7 +46,7 @@ ArmatureDataManager *ArmatureDataManager::getInstance()
|
|||
return s_sharedArmatureDataManager;
|
||||
}
|
||||
|
||||
void ArmatureDataManager::purge()
|
||||
void ArmatureDataManager::destoryInstance()
|
||||
{
|
||||
SpriteFrameCacheHelper::purge();
|
||||
DataReaderHelper::purge();
|
||||
|
|
|
@ -40,9 +40,12 @@ public:
|
|||
/** @deprecated Use getInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static ArmatureDataManager *sharedArmatureDataManager() { return ArmatureDataManager::getInstance(); }
|
||||
|
||||
/** @deprecated Use destoryInstance() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE static void purge() { ArmatureDataManager::destoryInstance(); };
|
||||
|
||||
static ArmatureDataManager *getInstance();
|
||||
|
||||
static void purge();
|
||||
static void destoryInstance();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @js ctor
|
||||
|
|
|
@ -163,7 +163,7 @@ void ArmatureTestLayer::onEnter()
|
|||
|
||||
addChild(menu, 100);
|
||||
|
||||
setShaderProgram(ShaderCache::getInstance()->programForKey(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
||||
setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
|
||||
|
||||
}
|
||||
void ArmatureTestLayer::onExit()
|
||||
|
@ -171,6 +171,8 @@ void ArmatureTestLayer::onExit()
|
|||
removeAllChildren();
|
||||
|
||||
backItem = restartItem = nextItem = NULL;
|
||||
|
||||
Layer::onExit();
|
||||
}
|
||||
|
||||
std::string ArmatureTestLayer::title()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "testBasic.h"
|
||||
#include "controller.h"
|
||||
#include "cocos-ext.h"
|
||||
|
||||
TestScene::TestScene(bool bPortrait)
|
||||
{
|
||||
|
@ -45,6 +46,8 @@ void TestScene::onEnter()
|
|||
Director::getInstance()->replaceScene(scene);
|
||||
scene->release();
|
||||
}
|
||||
|
||||
cocos2d::extension::armature::ArmatureDataManager::destoryInstance();
|
||||
});
|
||||
|
||||
auto menu =Menu::create(menuItem, NULL);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "VisibleRect.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
using namespace std;
|
||||
|
||||
class TestScene : public Scene
|
||||
|
|
Loading…
Reference in New Issue