Fixing armature test crash.

This commit is contained in:
James Chen 2013-09-17 23:03:33 +08:00
parent aaf4a6a81b
commit 513237d5f6
5 changed files with 13 additions and 4 deletions

View File

@ -46,7 +46,7 @@ ArmatureDataManager *ArmatureDataManager::getInstance()
return s_sharedArmatureDataManager;
}
void ArmatureDataManager::purge()
void ArmatureDataManager::destoryInstance()
{
SpriteFrameCacheHelper::purge();
DataReaderHelper::purge();

View File

@ -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

View File

@ -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()

View File

@ -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);

View File

@ -5,6 +5,7 @@
#include "VisibleRect.h"
USING_NS_CC;
using namespace std;
class TestScene : public Scene