Commit 83f68573 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

mainapplication: fix destruction ordering

Every models (like UtilsAdapter for example) owns a pointer of
LRCInstance. So, when the MainApplication is destroyed, the QmlEngine
and all structures owning a pointer of LRCInstance MUST be destroyed
before LRCInstance to avoid any segfault

GitLab: #631
Change-Id: Id30aaca325fe7172188bba468acd73525e62a34a
parent 84a60d39
......@@ -155,7 +155,11 @@ MainApplication::MainApplication(int& argc, char** argv)
QObject::connect(this, &QApplication::aboutToQuit, [this] { cleanup(); });
}
MainApplication::~MainApplication() {}
MainApplication::~MainApplication()
{
engine_.reset();
lrcInstance_.reset();
}
bool
MainApplication::init()
......
......@@ -80,7 +80,6 @@ private:
private:
QScopedPointer<QFile> debugFile_;
QScopedPointer<QQmlApplicationEngine> engine_;
QScopedPointer<LRCInstance> lrcInstance_;
QScopedPointer<ConnectivityMonitor> connectivityMonitor_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment