diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp index b2fa7b8b68..e67f9a72e4 100644 --- a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp +++ b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.cpp @@ -46,7 +46,7 @@ ArmatureDataManager *ArmatureDataManager::getInstance() return s_sharedArmatureDataManager; } -void ArmatureDataManager::purge() +void ArmatureDataManager::destoryInstance() { SpriteFrameCacheHelper::purge(); DataReaderHelper::purge(); diff --git a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h index 6bef41bb13..5b7d534d44 100644 --- a/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h +++ b/extensions/CocoStudio/Armature/utils/CCArmatureDataManager.h @@ -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 diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp index 7456204bd6..e5a62d7bac 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/CocoStudioArmatureTest/ArmatureScene.cpp @@ -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() diff --git a/samples/Cpp/TestCpp/Classes/testBasic.cpp b/samples/Cpp/TestCpp/Classes/testBasic.cpp index c1c7b22bad..5926c0a000 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.cpp +++ b/samples/Cpp/TestCpp/Classes/testBasic.cpp @@ -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); diff --git a/samples/Cpp/TestCpp/Classes/testBasic.h b/samples/Cpp/TestCpp/Classes/testBasic.h index f4be332a7d..020aab48bd 100644 --- a/samples/Cpp/TestCpp/Classes/testBasic.h +++ b/samples/Cpp/TestCpp/Classes/testBasic.h @@ -5,6 +5,7 @@ #include "VisibleRect.h" USING_NS_CC; + using namespace std; class TestScene : public Scene