diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index e7ccbd72aa..296865cd6b 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -176,7 +176,7 @@ Director::~Director(void) CC_SAFE_RELEASE(_notificationNode); CC_SAFE_RELEASE(_scheduler); CC_SAFE_RELEASE(_actionManager); - CC_SAFE_RELEASE(_eventDispatcher); + delete _eventAfterUpdate; delete _eventAfterDraw; @@ -189,6 +189,8 @@ Director::~Director(void) delete _console; #endif + CC_SAFE_RELEASE(_eventDispatcher); + // clean auto release pool PoolManager::destroyInstance(); diff --git a/cocos/2d/renderer/CCRenderer.cpp b/cocos/2d/renderer/CCRenderer.cpp index 0a54dcbd72..e0b49f8aee 100644 --- a/cocos/2d/renderer/CCRenderer.cpp +++ b/cocos/2d/renderer/CCRenderer.cpp @@ -43,7 +43,7 @@ NS_CC_BEGIN // helper -bool compareRenderCommand(RenderCommand* a, RenderCommand* b) +static bool compareRenderCommand(RenderCommand* a, RenderCommand* b) { return a->getGlobalOrder() < b->getGlobalOrder(); }