From 044486f8b41b9ae7bdfad838be79ec5b2782fed5 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 8 Jul 2014 07:43:27 +1000 Subject: [sensorfw] need to run init after sensord has been restarted This ensures things are setup and work properly. Change-Id: I23c8b53e760d49695c5ae207eed77a2e7d2be3a4 Reviewed-by: Alex Blasche --- src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp') diff --git a/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp b/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp index c0ba0696..b63e7f6e 100644 --- a/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp +++ b/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp @@ -86,3 +86,10 @@ void SensorfwRotationSensor::init() m_initDone = false; initSensor(m_initDone); } + +void SensorfwRotationSensor::start() +{ + if (reinitIsNeeded) + init(); + SensorfwSensorBase::start(); +} -- cgit v1.2.3 From 9f377d1fa286817a17a5e5de3786a2d73aeaa822 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Mon, 7 Jul 2014 16:58:22 +1000 Subject: 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 Change-Id: I5c1bf3999ad2268c0dba9b3fe511d999c2e63fd9 Reviewed-by: Alex Blasche --- src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp') diff --git a/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp b/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp index b63e7f6e..87d547c6 100644 --- a/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp +++ b/src/plugins/sensors/sensorfw/sensorfwrotationsensor.cpp @@ -71,6 +71,7 @@ void SensorfwRotationSensor::slotFrameAvailable(const QVector& frame) bool SensorfwRotationSensor::doConnect() { + Q_ASSERT(m_sensorInterface); if (m_bufferSize==1) return QObject::connect(m_sensorInterface, SIGNAL(dataAvailable(XYZ)), this, SLOT(slotDataAvailable(XYZ))); return QObject::connect(m_sensorInterface, SIGNAL(frameAvailable(QVector)),this, SLOT(slotFrameAvailable(QVector))); -- cgit v1.2.3