mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[cocos2dx] Closes #605, crash on iOS when system UI is triggered.
This commit is contained in:
parent
506796c667
commit
db05421930
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user