[cocos2dx] Closes #605, crash on iOS when system UI is triggered.

This commit is contained in:
badlogic 2016-07-18 16:19:55 +02:00
parent 506796c667
commit db05421930

View File

@ -34,6 +34,7 @@
#include <algorithm>
USING_NS_CC;
#define EVENT_AFTER_DRAW_RESET_POSITION "director_after_draw"
using std::max;
namespace spine {
@ -57,11 +58,13 @@ SkeletonBatch::SkeletonBatch (int capacity) :
_firstCommand = new Command();
_command = _firstCommand;
Director::getInstance()->getScheduler()->scheduleUpdate(this, -1, false);
Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom* eventCustom){
this->update(0);
});;
}
SkeletonBatch::~SkeletonBatch () {
Director::getInstance()->getScheduler()->unscheduleUpdate(this);
Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION);
Command* command = _firstCommand;
while (command) {