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>
This commit is contained in:
Jan Mulder 2017-06-08 13:38:52 +02:00 committed by Dirk Hohndel
parent 22e40063f1
commit a7288cc912
3 changed files with 6 additions and 3 deletions

View file

@ -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