From 63f54cb5f7d6fdf0833c51619d5bb6b2b0b362fa Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 17 Apr 2014 10:15:11 +0800 Subject: [PATCH] closed #4568: Application crashes on closing if CC_ENABLE_CACHE_TEXTURE_DATA is enabled. CC_SAFE_RELEASE(_eventDispatcher); should be after 'delete _renderer;' in Director's destructor. --- cocos/2d/CCDirector.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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();