Fixing crash of ACC-Test.

This commit is contained in:
James Chen 2013-09-19 08:12:54 +08:00
parent fa71f8f479
commit 40258ede68
1 changed files with 2 additions and 2 deletions

View File

@ -343,8 +343,8 @@ void Layer::onEnter()
{
auto dispatcher = EventDispatcher::getInstance();
dispatcher->removeEventListener(_accelerationListener);
auto listener = AccelerationEventListener::create(CC_CALLBACK_2(Layer::onAcceleration, this));
dispatcher->addEventListenerWithSceneGraphPriority(listener, this);
_accelerationListener = AccelerationEventListener::create(CC_CALLBACK_2(Layer::onAcceleration, this));
dispatcher->addEventListenerWithSceneGraphPriority(_accelerationListener, this);
}
}