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:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "core/btdiscovery.h"
|
||||
#include "core/gpslocation.h"
|
||||
#include "core/downloadfromdcthread.h"
|
||||
#include "qt-models/divelistmodel.h"
|
||||
|
||||
class QMLManager : public QObject {
|
||||
@@ -204,6 +205,7 @@ private:
|
||||
bool checkDepth(DiveObjectHelper *myDive, struct dive *d, QString depth);
|
||||
bool currentGitLocalOnly;
|
||||
bool m_showPin;
|
||||
DCDeviceData *m_device_data;
|
||||
|
||||
signals:
|
||||
void cloudUserNameChanged();
|
||||
|
||||
Reference in New Issue
Block a user