Commit b34e0978 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Destroy backends when closing

parent a331ff88
......@@ -126,6 +126,12 @@ DiscoverObject::DiscoverObject(CompactMode mode)
connect(m_engine, &QQmlApplicationEngine::objectCreated, this, &DiscoverObject::integrateObject);
m_engine->load(QUrl(QStringLiteral("qrc:/qml/DiscoverWindow.qml")));
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, [this](){
const auto objs = m_engine->rootObjects();
for(auto o: objs)
delete o;
});
}
DiscoverObject::~DiscoverObject()
......
......@@ -76,6 +76,8 @@ void ResourcesModel::init(bool load)
m_updateAction->setEnabled(!fetching);
});
connect(m_updateAction, &QAction::triggered, this, &ResourcesModel::checkForUpdates);
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &QObject::deleteLater);
}
ResourcesModel::ResourcesModel(const QString& backendName, QObject* parent)
......@@ -87,6 +89,7 @@ ResourcesModel::ResourcesModel(const QString& backendName, QObject* parent)
ResourcesModel::~ResourcesModel()
{
s_self = nullptr;
qDeleteAll(m_backends);
}
......
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