mirror of https://github.com/axmolengine/axmol.git
Fixing crash of ACC-Test.
This commit is contained in:
parent
fa71f8f479
commit
40258ede68
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue