summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@jollamobile.com>2014-07-07 16:58:22 +1000
committerLorn Potter <lorn.potter@jollamobile.com>2014-07-10 21:58:02 +0200
commit9f377d1fa286817a17a5e5de3786a2d73aeaa822 (patch)
treeaecefd0f3e6e9f8b74420af1e0ce558ef47fb8f0 /src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp
parent044486f8b41b9ae7bdfad838be79ec5b2782fed5 (diff)
Series of crash fixes from Mer, squashed
1)tracing plugin loading 2)m_remoteSensorManager can be nullptr But it seems it does not solve incorrect initialization in the case manager interface is nullptr: init() for different sensors does not check initDone 3)split initSensor() to template function and function most of initSensor() does not depend on template param, so it is better to split it -> less code should be generated 4)do not use sensor manager if it is invalid 5)correct class members initialization order 6)assert sensor interface is not null From what I saw according to logic it should not happen so using Q_ASSERT for better maintainability 7)check local interface pointer in SensorfwTapSensor::start() Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com> Change-Id: I5c1bf3999ad2268c0dba9b3fe511d999c2e63fd9 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp')
-rw-r--r--src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp b/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp
index 4d91a024..b8d782d9 100644
--- a/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp
+++ b/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp
@@ -46,8 +46,8 @@ char const * const SensorfwProximitySensor::id("sensorfw.proximitysensor");
SensorfwProximitySensor::SensorfwProximitySensor(QSensor *sensor)
: SensorfwSensorBase(sensor),
+ m_initDone(false),
m_exClose(false)
- , m_initDone(false)
{
init();
setReading<QProximityReading>(&m_reading);
@@ -81,6 +81,7 @@ void SensorfwProximitySensor::slotDataAvailable(const Unsigned& data)
bool SensorfwProximitySensor::doConnect()
{
+ Q_ASSERT(m_sensorInterface);
return (QObject::connect(m_sensorInterface, SIGNAL(dataAvailable(Unsigned)),
this, SLOT(slotDataAvailable(Unsigned))));
}