From 40258ede68e4116c4a7ed0b08a35edaeffb89778 Mon Sep 17 00:00:00 2001 From: James Chen Date: Thu, 19 Sep 2013 08:12:54 +0800 Subject: [PATCH] Fixing crash of ACC-Test. --- cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index f4b89159c2..9e4fa9d1de 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -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); } }