Changeset a7288cc in subsurface


Ignore:
Timestamp:
Jun 12, 2017, 9:49:05 AM (2 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
f6e94e6
Parents:
22e4006
git-author:
Jan Mulder <jlmulder@…> (06/08/17 04:38:52)
git-committer:
Dirk Hohndel <dirk@…> (06/12/17 09:49:05)
Message:

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@…>
Signed-off-by: Dirk Hohndel <dirk@…>

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/downloadfromdcthread.cpp

    rb14a522 ra7288cc  
    1717}
    1818
    19 DownloadThread::DownloadThread() : m_data(new DCDeviceData())
    20 {
    21 }
    22 
     19DownloadThread::DownloadThread()
     20{
     21        m_data = DCDeviceData::instance();
     22}
    2323
    2424void DownloadThread::run()
  • mobile-widgets/qmlmanager.cpp

    rb14a522 ra7288cc  
    9292        m_selectedDiveTimestamp(0),
    9393        m_credentialStatus(UNKNOWN),
    94         alreadySaving(false)
     94        alreadySaving(false),
     95        m_device_data(new DCDeviceData(this))
    9596{
    9697#if defined(BT_SUPPORT)
  • mobile-widgets/qmlmanager.h

    rb14a522 ra7288cc  
    1919#include "core/btdiscovery.h"
    2020#include "core/gpslocation.h"
     21#include "core/downloadfromdcthread.h"
    2122#include "qt-models/divelistmodel.h"
    2223
     
    205206        bool currentGitLocalOnly;
    206207        bool m_showPin;
     208        DCDeviceData *m_device_data;
    207209
    208210signals:
Note: See TracChangeset for help on using the changeset viewer.