restore CCLayer:onExit()

This commit is contained in:
dualface 2012-09-20 11:32:02 +08:00
parent 36908396d2
commit 1a162a09ad
1 changed files with 4 additions and 1 deletions

View File

@ -257,7 +257,10 @@ void CCLayer::onEnter()
void CCLayer::onExit()
{
CCDirector* pDirector = CCDirector::sharedDirector();
pDirector->getTouchDispatcher()->removeDelegate(this);
if( m_bIsTouchEnabled )
{
pDirector->getTouchDispatcher()->removeDelegate(this);
}
// remove this layer from the delegates who concern Accelerometer Sensor
if (m_bIsAccelerometerEnabled)