path: root/src/plugins/sensors/ios/iosaccelerometer.h
diff options
authorRichard Moe Gustavsen <>2016-08-24 14:19:40 +0200
committerRichard Moe Gustavsen <>2016-08-25 07:57:22 +0000
commit46d9a630a88fc5388dec7fd99289d0e9e0e1f680 (patch)
tree282f24c50f249090994791e7224af2b82e31db62 /src/plugins/sensors/ios/iosaccelerometer.h
parentf2f289b5048eab47901fe75dd41770ffd630dead (diff)
iOS: protect OS sensors from being stopped when shared by several Qt sensors
When a Qt sensor is told to stop, it automatically stops the underlying OS sensor as well. This caused a problem when several Qt sensors were running, since stopping one would stop them all. This patch will add a ref count for each affected sensor, so that we keep track of when it's safe to start and stop the underlying OS sensor. Task-number: QTBUG-54977 Change-Id: If06c4daac22916feef2f4c7bd521363d74f342a6 Reviewed-by: Edward Welbourne <> Reviewed-by: Lorn Potter <>
Diffstat (limited to 'src/plugins/sensors/ios/iosaccelerometer.h')
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/sensors/ios/iosaccelerometer.h b/src/plugins/sensors/ios/iosaccelerometer.h
index 05de7a26..94a2ed8e 100644
--- a/src/plugins/sensors/ios/iosaccelerometer.h
+++ b/src/plugins/sensors/ios/iosaccelerometer.h
@@ -56,6 +56,8 @@ private:
CMMotionManager *m_motionManager;
QAccelerometerReading m_reading;
int m_timer;
+ static int s_startCount;