This commit is contained in:
natural-law 2010-11-05 09:29:24 +00:00
parent 5858a5ada4
commit c165ad36a7
1 changed files with 7 additions and 6 deletions

View File

@ -36,15 +36,16 @@ CCTouchDelegate* CCTouchHandler::getDelegate(void)
void CCTouchHandler::setDelegate(CCTouchDelegate *pDelegate) void CCTouchHandler::setDelegate(CCTouchDelegate *pDelegate)
{ {
if (m_pDelegate) if (pDelegate)
{ {
pDelegate->keep(); pDelegate->keep();
} }
if (m_pDelegate)
{
m_pDelegate->destroy();
}
m_pDelegate = pDelegate; m_pDelegate = pDelegate;
if (m_pDelegate)
{
m_pDelegate->destroy();
}
} }
int CCTouchHandler::getPriority(void) int CCTouchHandler::getPriority(void)