From c165ad36a7da281b46f8be188a149e7470ab4929 Mon Sep 17 00:00:00 2001 From: natural-law Date: Fri, 5 Nov 2010 09:29:24 +0000 Subject: [PATCH] debug --- cocos2dx/touch_dispatcher/CCTouchHandler.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cocos2dx/touch_dispatcher/CCTouchHandler.cpp b/cocos2dx/touch_dispatcher/CCTouchHandler.cpp index ebd4470dcb..c5fa1f4908 100644 --- a/cocos2dx/touch_dispatcher/CCTouchHandler.cpp +++ b/cocos2dx/touch_dispatcher/CCTouchHandler.cpp @@ -36,15 +36,16 @@ CCTouchDelegate* CCTouchHandler::getDelegate(void) void CCTouchHandler::setDelegate(CCTouchDelegate *pDelegate) { - if (m_pDelegate) + if (pDelegate) { pDelegate->keep(); - } + } + + if (m_pDelegate) + { + m_pDelegate->destroy(); + } m_pDelegate = pDelegate; - if (m_pDelegate) - { - m_pDelegate->destroy(); - } } int CCTouchHandler::getPriority(void)