From a7288cc912267415196cfa956b7813752748c35c Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Thu, 8 Jun 2017 13:38:52 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- core/downloadfromdcthread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index bd8a637f1..9583eff15 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -16,11 +16,11 @@ static QString str_error(const char *fmt, ...) return str; } -DownloadThread::DownloadThread() : m_data(new DCDeviceData()) +DownloadThread::DownloadThread() { + m_data = DCDeviceData::instance(); } - void DownloadThread::run() { auto internalData = m_data->internalData(); -- cgit v1.2.3-70-g09d2