diff options
author | Lorn Potter <lorn.potter@jollamobile.com> | 2014-07-07 16:58:22 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@jollamobile.com> | 2014-07-10 21:58:02 +0200 |
commit | 9f377d1fa286817a17a5e5de3786a2d73aeaa822 (patch) | |
tree | aecefd0f3e6e9f8b74420af1e0ce558ef47fb8f0 /src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp | |
parent | 044486f8b41b9ae7bdfad838be79ec5b2782fed5 (diff) | |
download | qtsensors-9f377d1fa286817a17a5e5de3786a2d73aeaa822.tar.gz |
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/sensorfwirproximitysensor.cpp')
-rw-r--r-- | src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp index 6855158..145276e 100644 --- a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp +++ b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp @@ -67,6 +67,7 @@ void SensorfwIrProximitySensor::slotDataAvailable(const Proximity& proximity) bool SensorfwIrProximitySensor::doConnect() { + Q_ASSERT(m_sensorInterface); return QObject::connect(m_sensorInterface, SIGNAL(reflectanceDataAvailable(Proximity)), this, SLOT(slotDataAvailable(Proximity))); } |