From 69762e4b4cd62961b5ca701d14348b626085fdb5 Mon Sep 17 00:00:00 2001 From: Ming Date: Mon, 6 Sep 2010 03:48:04 +0000 Subject: [PATCH] issue #61: --- cocos2dx/touch_dispatcher/CCTouchHandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cocos2dx/touch_dispatcher/CCTouchHandler.cpp b/cocos2dx/touch_dispatcher/CCTouchHandler.cpp index 7c7f19f15f..ebd4470dcb 100644 --- a/cocos2dx/touch_dispatcher/CCTouchHandler.cpp +++ b/cocos2dx/touch_dispatcher/CCTouchHandler.cpp @@ -36,7 +36,15 @@ CCTouchDelegate* CCTouchHandler::getDelegate(void) void CCTouchHandler::setDelegate(CCTouchDelegate *pDelegate) { + if (m_pDelegate) + { + pDelegate->keep(); + } m_pDelegate = pDelegate; + if (m_pDelegate) + { + m_pDelegate->destroy(); + } } int CCTouchHandler::getPriority(void)