Merge pull request #3703 from dumganhar/iss2087-new-event-dispatcher

Fixing crash of ACC-Test.[ci skip]
This commit is contained in:
James Chen 2013-09-18 17:21:48 -07:00
commit 5570b6089a
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);
}
}