From 6f20da4444aab1634b2cdca1fa756ac4379ee0b6 Mon Sep 17 00:00:00 2001 From: pipu Date: Mon, 30 Mar 2015 16:46:33 +0800 Subject: [PATCH] Add destroyCocosStudio() --- .../cocostudio/ActionTimeline/CSLoader.cpp | 30 +++++++++++++++++++ .../cocostudio/ActionTimeline/CSLoader.h | 2 ++ .../cocostudio/FlatBuffersSerialize.cpp | 4 +-- .../cocostudio/FlatBuffersSerialize.h | 2 +- .../ArmatureNodeReader/ArmatureNodeReader.cpp | 5 ++++ .../ArmatureNodeReader/ArmatureNodeReader.h | 2 +- .../ButtonReader/ButtonReader.cpp | 2 +- .../WidgetReader/ButtonReader/ButtonReader.h | 2 +- .../CheckBoxReader/CheckBoxReader.cpp | 5 ++++ .../CheckBoxReader/CheckBoxReader.h | 2 +- .../ComAudioReader/ComAudioReader.cpp | 2 +- .../ComAudioReader/ComAudioReader.h | 2 +- .../ImageViewReader/ImageViewReader.cpp | 5 ++++ .../ImageViewReader/ImageViewReader.h | 2 +- .../LayoutReader/LayoutReader.cpp | 5 ++++ .../WidgetReader/LayoutReader/LayoutReader.h | 2 +- .../ListViewReader/ListViewReader.cpp | 5 ++++ .../ListViewReader/ListViewReader.h | 2 +- .../LoadingBarReader/LoadingBarReader.cpp | 5 ++++ .../LoadingBarReader/LoadingBarReader.h | 2 +- .../Node3DReader/Node3DReader.cpp | 2 +- .../WidgetReader/Node3DReader/Node3DReader.h | 2 +- .../WidgetReader/NodeReader/NodeReader.cpp | 2 +- .../WidgetReader/NodeReader/NodeReader.h | 2 +- .../PageViewReader/PageViewReader.cpp | 5 ++++ .../PageViewReader/PageViewReader.h | 2 +- .../Particle3DReader/Particle3DReader.cpp | 2 +- .../Particle3DReader/Particle3DReader.h | 2 +- .../ParticleReader/ParticleReader.cpp | 2 +- .../ParticleReader/ParticleReader.h | 2 +- .../ProjectNodeReader/ProjectNodeReader.cpp | 2 +- .../ProjectNodeReader/ProjectNodeReader.h | 2 +- .../ScrollViewReader/ScrollViewReader.cpp | 5 ++++ .../ScrollViewReader/ScrollViewReader.h | 2 +- .../SingleNodeReader/SingleNodeReader.cpp | 2 +- .../SingleNodeReader/SingleNodeReader.h | 2 +- .../SliderReader/SliderReader.cpp | 5 ++++ .../WidgetReader/SliderReader/SliderReader.h | 2 +- .../Sprite3DReader/Sprite3DReader.cpp | 2 +- .../Sprite3DReader/Sprite3DReader.h | 2 +- .../SpriteReader/SpriteReader.cpp | 2 +- .../WidgetReader/SpriteReader/SpriteReader.h | 2 +- .../TextAtlasReader/TextAtlasReader.cpp | 5 ++++ .../TextAtlasReader/TextAtlasReader.h | 1 + .../TextBMFontReader/TextBMFontReader.cpp | 5 ++++ .../TextBMFontReader/TextBMFontReader.h | 2 +- .../TextFieldReader/TextFieldReader.cpp | 5 ++++ .../TextFieldReader/TextFieldReader.h | 2 +- .../WidgetReader/TextReader/TextReader.cpp | 5 ++++ .../WidgetReader/TextReader/TextReader.h | 2 +- .../UserCameraReader/UserCameraReader.cpp | 2 +- .../UserCameraReader/UserCameraReader.h | 2 +- .../cocostudio/WidgetReader/WidgetReader.cpp | 2 +- .../cocostudio/WidgetReader/WidgetReader.h | 2 +- 54 files changed, 137 insertions(+), 39 deletions(-) diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp index bee63a0aea..463b571154 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.cpp @@ -218,6 +218,36 @@ void CSLoader::purge() { } +void CSLoader::destroyCocosStudio() +{ + NodeReader::destroyInstance(); + SingleNodeReader::destroyInstance(); + SpriteReader::destroyInstance(); + ParticleReader::destroyInstance(); + + ButtonReader::destroyInstance(); + CheckBoxReader::destroyInstance(); + ImageViewReader::destroyInstance(); + TextBMFontReader::destroyInstance(); + TextReader::destroyInstance(); + TextFieldReader::destroyInstance(); + TextAtlasReader::destroyInstance(); + LoadingBarReader::destroyInstance(); + SliderReader::destroyInstance(); + LayoutReader::destroyInstance(); + ScrollViewReader::destroyInstance(); + PageViewReader::destroyInstance(); + ListViewReader::destroyInstance(); + + ArmatureNodeReader::destroyInstance(); + Node3DReader::destroyInstance(); + Sprite3DReader::destroyInstance(); + UserCameraReader::destroyInstance(); + Particle3DReader::destroyInstance(); + + destroyInstance(); +} + void CSLoader::init() { using namespace std::placeholders; diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h index ef36a8b4a9..a0284db744 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h +++ b/cocos/editor-support/cocostudio/ActionTimeline/CSLoader.h @@ -74,6 +74,8 @@ public: CSLoader(); void purge(); + static void destroyCocosStudio(); + void init(); static cocos2d::Node* createNode(const std::string& filename); diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp index 7604658117..bf257c2625 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.cpp @@ -111,7 +111,7 @@ FlatBuffersSerialize::FlatBuffersSerialize() FlatBuffersSerialize::~FlatBuffersSerialize() { - purge(); + } FlatBuffersSerialize* FlatBuffersSerialize::getInstance() @@ -124,7 +124,7 @@ FlatBuffersSerialize* FlatBuffersSerialize::getInstance() return _instanceFlatBuffersSerialize; } -void FlatBuffersSerialize::purge() +void FlatBuffersSerialize::destroyInstance() { CC_SAFE_DELETE(_instanceFlatBuffersSerialize); diff --git a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h index 9cd0d804f2..d0f0bcfb2e 100644 --- a/cocos/editor-support/cocostudio/FlatBuffersSerialize.h +++ b/cocos/editor-support/cocostudio/FlatBuffersSerialize.h @@ -91,7 +91,7 @@ class CC_STUDIO_DLL FlatBuffersSerialize public: static FlatBuffersSerialize* getInstance(); - static void purge(); + static void destroyInstance(); FlatBuffersSerialize(); ~FlatBuffersSerialize(); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp index 6d7189c225..957293280a 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp @@ -34,6 +34,11 @@ ArmatureNodeReader* ArmatureNodeReader::getInstance() return _instanceArmatureNodeReader; } +void ArmatureNodeReader::destroyInstance() +{ + CC_SAFE_DELETE(_instanceArmatureNodeReader); +} + Offset ArmatureNodeReader::createOptionsWithFlatBuffers(const tinyxml2::XMLElement *objectData, flatbuffers::FlatBufferBuilder *builder) { diff --git a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h index a3930d8ed2..5416d4779c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.h @@ -50,7 +50,7 @@ public: ~ArmatureNodeReader(); static ArmatureNodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder) override; diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp index 6025bea066..cdb34861fc 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.cpp @@ -59,7 +59,7 @@ namespace cocostudio return instanceButtonReader; } - void ButtonReader::purge() + void ButtonReader::destroyInstance() { CC_SAFE_DELETE(instanceButtonReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h index 2c1c969337..cd6a1aeaa8 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ButtonReader/ButtonReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~ButtonReader(); static ButtonReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp index ae95206b78..09148b143d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp @@ -45,6 +45,11 @@ namespace cocostudio return instanceCheckBoxReader; } + void CheckBoxReader::destroyInstance() + { + CC_SAFE_DELETE(instanceCheckBoxReader); + } + void CheckBoxReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { diff --git a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h index df1b1857cb..76289b54ac 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~CheckBoxReader(); static CheckBoxReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp index 2017f245ee..e194187adf 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.cpp @@ -58,7 +58,7 @@ namespace cocostudio return _instanceComAudioReader; } - void ComAudioReader::purge() + void ComAudioReader::destroyInstance() { CC_SAFE_DELETE(_instanceComAudioReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h index 5994b2f659..bb82865622 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ComAudioReader/ComAudioReader.h @@ -40,7 +40,7 @@ namespace cocostudio ~ComAudioReader(); static ComAudioReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp index e08bc0c63a..f72f9802ec 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.cpp @@ -49,6 +49,11 @@ namespace cocostudio return instanceImageViewReader; } + void ImageViewReader::destroyInstance() + { + CC_SAFE_DELETE(instanceImageViewReader); + } + void ImageViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h index 113276ec64..8c26b047da 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ImageViewReader/ImageViewReader.h @@ -41,7 +41,7 @@ namespace cocostudio virtual ~ImageViewReader(); static ImageViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp index bb796b83de..25b1708182 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.cpp @@ -64,6 +64,11 @@ namespace cocostudio return instanceLayoutReader; } + void LayoutReader::destroyInstance() + { + CC_SAFE_DELETE(instanceLayoutReader); + } + void LayoutReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h index 4cd08e224c..1f4e23da81 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h @@ -40,7 +40,7 @@ namespace cocostudio virtual ~LayoutReader(); static LayoutReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp index 80245ed1a2..6856a4432d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp @@ -42,6 +42,11 @@ namespace cocostudio return instanceListViewReader; } + void ListViewReader::destroyInstance() + { + CC_SAFE_DELETE(instanceListViewReader); + } + void ListViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { ScrollViewReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h index 4f260f4468..295caf46c2 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~ListViewReader(); static ListViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp index 3fe61ee47a..accff552ec 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp @@ -48,6 +48,11 @@ namespace cocostudio return instanceLoadingBar; } + void LoadingBarReader::destroyInstance() + { + CC_SAFE_DELETE(instanceLoadingBar); + } + void LoadingBarReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { WidgetReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h index 955eb009f4..8e5634aefd 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~LoadingBarReader(); static LoadingBarReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp index 640e59cb62..9819416732 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.cpp @@ -62,7 +62,7 @@ namespace cocostudio return _instanceNode3DReader; } - void Node3DReader::purge() + void Node3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceNode3DReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h index cf12772e5e..6d6747527c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Node3DReader/Node3DReader.h @@ -46,7 +46,7 @@ namespace cocostudio ~Node3DReader(); static Node3DReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp index a0ad52d60d..060c9c9ceb 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.cpp @@ -79,7 +79,7 @@ namespace cocostudio return _instanceNodeReader; } - void NodeReader::purge() + void NodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceNodeReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h index 84049e6d73..0def64fa63 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/NodeReader/NodeReader.h @@ -41,7 +41,7 @@ namespace cocostudio ~NodeReader(); static NodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp index 2a02d99004..0fde47f3be 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp @@ -40,6 +40,11 @@ namespace cocostudio return instancePageViewReader; } + void PageViewReader::destroyInstance() + { + CC_SAFE_DELETE(instancePageViewReader); + } + void PageViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { LayoutReader::setPropsFromBinary(widget, cocoLoader, cocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h index d2f90d9d38..4968d89dec 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~PageViewReader(); static PageViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp index f3a457f53c..f0a3479940 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.cpp @@ -63,7 +63,7 @@ namespace cocostudio return _instanceParticle3DReader; } - void Particle3DReader::purge() + void Particle3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticle3DReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h index a3a5dfaa28..a57e810fff 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Particle3DReader/Particle3DReader.h @@ -41,7 +41,7 @@ namespace cocostudio ~Particle3DReader(); static Particle3DReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp index ffc2190e74..c72f06a863 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.cpp @@ -59,7 +59,7 @@ namespace cocostudio return _instanceParticleReader; } - void ParticleReader::purge() + void ParticleReader::destroyInstance() { CC_SAFE_DELETE(_instanceParticleReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h index 80841256fb..60ef3021d1 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ParticleReader/ParticleReader.h @@ -42,7 +42,7 @@ namespace cocostudio ~ParticleReader(); static ParticleReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp index 6b0c73a53c..d9848a05a9 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.cpp @@ -57,7 +57,7 @@ namespace cocostudio return _instanceProjectNodeReader; } - void ProjectNodeReader::purge() + void ProjectNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceProjectNodeReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h index 48b2fccd43..9e5c4973fe 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ProjectNodeReader/ProjectNodeReader.h @@ -40,7 +40,7 @@ namespace cocostudio ~ProjectNodeReader(); static ProjectNodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp index eb6020f638..12e8a839f3 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.cpp @@ -44,6 +44,11 @@ namespace cocostudio return instanceScrollViewReader; } + void ScrollViewReader::destroyInstance() + { + CC_SAFE_DELETE(instanceScrollViewReader); + } + void ScrollViewReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { //TODO: need to refactor... diff --git a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h index de6f0e1f8f..4a69005329 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/ScrollViewReader/ScrollViewReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~ScrollViewReader(); static ScrollViewReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp index 9c26174ae4..2fccc1479c 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.cpp @@ -62,7 +62,7 @@ namespace cocostudio return _instanceSingleNodeReader; } - void SingleNodeReader::purge() + void SingleNodeReader::destroyInstance() { CC_SAFE_DELETE(_instanceSingleNodeReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h index 0a3f0b8c35..9d8c1c111d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SingleNodeReader/SingleNodeReader.h @@ -42,7 +42,7 @@ namespace cocostudio ~SingleNodeReader(); static SingleNodeReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp index 639d626ad6..1a40f4825b 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp @@ -48,6 +48,11 @@ namespace cocostudio return instanceSliderReader; } + void SliderReader::destroyInstance() + { + CC_SAFE_DELETE(instanceSliderReader); + } + void SliderReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h index b24aaa984c..6d01695b53 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~SliderReader(); static SliderReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp index aa141240d9..d901785ae7 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.cpp @@ -62,7 +62,7 @@ namespace cocostudio return _instanceSprite3DReader; } - void Sprite3DReader::purge() + void Sprite3DReader::destroyInstance() { CC_SAFE_DELETE(_instanceSprite3DReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h index 083310eb4d..5b2e2988ef 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/Sprite3DReader/Sprite3DReader.h @@ -46,7 +46,7 @@ namespace cocostudio ~Sprite3DReader(); static Sprite3DReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp index c03cf73324..cb46fe0971 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.cpp @@ -60,7 +60,7 @@ namespace cocostudio return _instanceSpriteReader; } - void SpriteReader::purge() + void SpriteReader::destroyInstance() { CC_SAFE_DELETE(_instanceSpriteReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h index 8dcc575339..37776a66ea 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/SpriteReader/SpriteReader.h @@ -42,7 +42,7 @@ namespace cocostudio ~SpriteReader(); static SpriteReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp index 09da4b64f9..6180d8fdda 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.cpp @@ -45,6 +45,11 @@ namespace cocostudio return instanceTextAtalsReader; } + void TextAtlasReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextAtalsReader); + } + void TextAtlasReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h index 98a3421c08..07c5675264 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextAtlasReader/TextAtlasReader.h @@ -39,6 +39,7 @@ namespace cocostudio virtual ~TextAtlasReader(); static TextAtlasReader* getInstance(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp index c3cc6d2665..8ab76248ab 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.cpp @@ -42,6 +42,11 @@ namespace cocostudio return instanceTextBMFontReader; } + void TextBMFontReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextBMFontReader); + } + void TextBMFontReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h index c489a272a7..823ed71be3 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextBMFontReader/TextBMFontReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~TextBMFontReader(); static TextBMFontReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp index 6de6920888..6b808ebf82 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp @@ -49,6 +49,11 @@ namespace cocostudio return instanceTextFieldReader; } + void TextFieldReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextFieldReader); + } + void TextFieldReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode* cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h index a51ceb7d3c..4b80a840b9 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~TextFieldReader(); static TextFieldReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode) ; diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp index c7c6f908cc..a49119f261 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.cpp @@ -47,6 +47,11 @@ namespace cocostudio return instanceTextReader; } + void TextReader::destroyInstance() + { + CC_SAFE_DELETE(instanceTextReader); + } + void TextReader::setPropsFromBinary(cocos2d::ui::Widget *widget, CocoLoader *cocoLoader, stExpCocoNode *cocoNode) { this->beginSetBasicProperties(widget); diff --git a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h index 70b32551af..67820e376d 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/TextReader/TextReader.h @@ -39,7 +39,7 @@ namespace cocostudio virtual ~TextReader(); static TextReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options); virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* pCocoNode); diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp index 32e662d4bc..80b479f648 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.cpp @@ -61,7 +61,7 @@ namespace cocostudio return _instanceUserCameraReader; } - void UserCameraReader::purge() + void UserCameraReader::destroyInstance() { CC_SAFE_DELETE(_instanceUserCameraReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h index 0028547c93..9dfc0f95d5 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/UserCameraReader/UserCameraReader.h @@ -46,7 +46,7 @@ namespace cocostudio ~UserCameraReader(); static UserCameraReader* getInstance(); - static void purge(); + static void destroyInstance(); flatbuffers::Offset createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData, flatbuffers::FlatBufferBuilder* builder); diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp index 88ddec98c2..3fe4b7ed45 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.cpp @@ -134,7 +134,7 @@ namespace cocostudio return instanceWidgetReader; } - void WidgetReader::purge() + void WidgetReader::destroyInstance() { CC_SAFE_DELETE(instanceWidgetReader); } diff --git a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h index 6e0a456753..e2fdaa5512 100644 --- a/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h +++ b/cocos/editor-support/cocostudio/WidgetReader/WidgetReader.h @@ -46,7 +46,7 @@ namespace cocostudio virtual ~WidgetReader(); static WidgetReader* getInstance(); - static void purge(); + static void destroyInstance(); virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);