summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Jan Mulder <jlmulder@xs4all.nl>2017-06-08 13:38:52 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-06-12 09:49:05 -0700
commita7288cc912267415196cfa956b7813752748c35c (patch)
tree0930b1b52ddcf6fef28bfda01b907652ac3d86ed /mobile-widgets/qmlmanager.cpp
parent22e40063f173e381ecf9385be0d1facc69770f02 (diff)
downloadsubsurface-a7288cc912267415196cfa956b7813752748c35c.tar.gz
QML UI: do not crash on selecting dive computers
For reasons unknown to me, the DCDeviceData instance was freed way too early, and used afterwards, obviously resulting in a SIGSEGV. This commit creates the DCDeviceData as a direct child of the QMLManager instance, ensuring it does not get freed prematurely. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 96bdab51e..02345342f 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -91,7 +91,8 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_updateSelectedDive(-1),
m_selectedDiveTimestamp(0),
m_credentialStatus(UNKNOWN),
- alreadySaving(false)
+ alreadySaving(false),
+ m_device_data(new DCDeviceData(this))
{
#if defined(BT_SUPPORT)
// ensure that we start the BTDiscovery - this should be triggered by the export of the class