From 3a5a1e6604f681ed817152aa5f1a6c8fef245180 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 18 Sep 2013 13:00:43 +0800 Subject: [PATCH] issue #2087: Invokes EventDispatcher::destroyInstance() when purging Director. --- cocos2dx/CCDirector.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index ee14e677e7..2917805903 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -49,6 +49,7 @@ THE SOFTWARE. #include "actions/CCActionManager.h" #include "sprite_nodes/CCAnimationCache.h" #include "event_dispatcher/CCTouch.h" +#include "event_dispatcher/CCEventDispatcher.h" #include "support/user_default/CCUserDefault.h" #include "shaders/ccGLStateCache.h" #include "shaders/CCShaderCache.h" @@ -696,7 +697,8 @@ void Director::purgeDirector() // cocos2d-x specific data structures UserDefault::destroyInstance(); NotificationCenter::destroyInstance(); - + EventDispatcher::destroyInstance(); + GL::invalidateStateCache(); CHECK_GL_ERROR_DEBUG();