mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3703 from dumganhar/iss2087-new-event-dispatcher
Fixing crash of ACC-Test.[ci skip]
This commit is contained in:
commit
5570b6089a
|
@ -343,8 +343,8 @@ void Layer::onEnter()
|
||||||
{
|
{
|
||||||
auto dispatcher = EventDispatcher::getInstance();
|
auto dispatcher = EventDispatcher::getInstance();
|
||||||
dispatcher->removeEventListener(_accelerationListener);
|
dispatcher->removeEventListener(_accelerationListener);
|
||||||
auto listener = AccelerationEventListener::create(CC_CALLBACK_2(Layer::onAcceleration, this));
|
_accelerationListener = AccelerationEventListener::create(CC_CALLBACK_2(Layer::onAcceleration, this));
|
||||||
dispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
dispatcher->addEventListenerWithSceneGraphPriority(_accelerationListener, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue