Supplement some Reader.

This commit is contained in:
pipu 2015-03-31 11:22:34 +08:00
parent 6f20da4444
commit a0a461f319
11 changed files with 35 additions and 5 deletions

View File

@ -224,7 +224,11 @@ void CSLoader::destroyCocosStudio()
SingleNodeReader::destroyInstance();
SpriteReader::destroyInstance();
ParticleReader::destroyInstance();
GameMapReader::destroyInstance();
ProjectNodeReader::destroyInstance();
ComAudioReader::destroyInstance();
WidgetReader::destroyInstance();
ButtonReader::destroyInstance();
CheckBoxReader::destroyInstance();
ImageViewReader::destroyInstance();

View File

@ -61,7 +61,7 @@ namespace cocostudio
return _instanceTMXTiledMapReader;
}
void GameMapReader::purge()
void GameMapReader::destroyInstance()
{
CC_SAFE_DELETE(_instanceTMXTiledMapReader);
}

View File

@ -42,7 +42,7 @@ namespace cocostudio
~GameMapReader();
static GameMapReader* getInstance();
static void purge();
static void destroyInstance();
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
flatbuffers::FlatBufferBuilder* builder);

View File

@ -102,6 +102,13 @@ void CocosStudio3DTestDemo::onEnter()
BaseTest::onEnter();
}
void CocosStudio3DTestDemo::onExit()
{
CSLoader::destroyCocosStudio();
BaseTest::onExit();
}
void CocosStudio3DTestDemo::restartCallback(Ref* sender)
{
auto s = new (std::nothrow) CS3DTestScene();

View File

@ -47,6 +47,7 @@ public:
virtual std::string title() const override;
virtual std::string subtitle() const override;
virtual void onEnter() override;
virtual void onExit() override;
};
class CSNode3DTest : public CocosStudio3DTestDemo

View File

@ -165,8 +165,7 @@ void ActionTimelineTestLayer::onExit()
backItem = restartItem = nextItem = nullptr;
ActionTimelineCache::getInstance()->purge();
CSLoader::getInstance()->purge();
CSLoader::destroyCocosStudio();
Layer::onExit();
}

View File

@ -200,6 +200,8 @@ void ArmatureTestLayer::onExit()
backItem = restartItem = nextItem = nullptr;
CSLoader::destroyCocosStudio();
Layer::onExit();
}

View File

@ -31,6 +31,13 @@ void CustomWidgetCallbackBindScene::onEnter()
addChild(pMenu, 1);
}
void CustomWidgetCallbackBindScene::onExit()
{
CSLoader::destroyCocosStudio();
Scene::onExit();
}
void CustomWidgetCallbackBindScene::runThisTest()
{
CSLoader* instance = CSLoader::getInstance();

View File

@ -10,6 +10,7 @@ class CustomWidgetCallbackBindScene : public TestScene
{
public:
virtual void onEnter() override;
virtual void onExit() override;
virtual void runThisTest();
void BackCallback(cocos2d::Ref* pSender);
};

View File

@ -19,6 +19,13 @@ UIScene_Editor::~UIScene_Editor()
}
void UIScene_Editor::onExit()
{
CSLoader::destroyCocosStudio();
Layer::onExit();
}
bool UIScene_Editor::init()
{
if (CCLayer::init())

View File

@ -59,6 +59,8 @@ public:
UIScene_Editor();
~UIScene_Editor();
virtual void onExit() override;
bool init();
virtual void previousCallback(Ref* sender, Widget::TouchEventType event);
virtual void nextCallback(Ref* sender, Widget::TouchEventType event);