SensorManager crash

SensorManager crash

BY 19 Sep 2013 Native Application Development
I am getting an intermittent crash when trying to remove a sensor listener from Tizen::Uix::Sensor::SensorManager on app shutdown
I construct and add a listener for SENSOR_TYPE_ACCELERATION in Frame::OnInitializing, checking all the necessary return results to verify success, and checking SensorManager.IsAvailable(SENSOR_TYPE_ACCELERATION) , and using GetMinInterval to set the interval,  all seems fine;
 
I remove the listener in Frame::OnTerminating() like so-

result r = m_SensorManager.RemoveSensorListener(*this, SENSOR_TYPE_ACCELERATION);

Which all works fine, about 90% of the time; however occaisionally the app crashes on termination with the following error in the log
 
E/Assert  ( 7026): result Tizen::Uix::Sensor::<unnamed>::StopSensorType(sensor_handle_s*, sensor_type_e)(592) > StartSensorCoreEventSensing() > sensor_stop() failed. [handle:0x191550, sensorTypeE:0, result:-5]
 
Even in a release build, I still get the assertion message and the “closed unexpectedly” popup.
 
I don’t understand what I’m doing wrong – can anyone help??!
 

 

Written by