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

Don't leak QNAM factories

parent e80405c4
......@@ -84,6 +84,7 @@ DiscoverMainWindow::DiscoverMainWindow(CompactMode mode)
, m_collection(this)
, m_engine(new QQmlApplicationEngine)
, m_mode(mode)
, m_networkAccessManagerFactory(new CachedNetworkAccessManagerFactory)
{
ResourcesModel *m = ResourcesModel::global();
m->integrateActions(actionCollection());
......@@ -109,8 +110,8 @@ DiscoverMainWindow::DiscoverMainWindow(CompactMode mode)
setupActions();
//Here we set up a cache for the screenshots
CachedNetworkAccessManagerFactory *networkAccessManagerFactory = new CachedNetworkAccessManagerFactory;
m_engine->setNetworkAccessManagerFactory(networkAccessManagerFactory);
delete m_engine->networkAccessManagerFactory();
m_engine->setNetworkAccessManagerFactory(m_networkAccessManagerFactory.data());
m_engine->rootContext()->setContextProperty(QStringLiteral("app"), this);
connect(m_engine, &QQmlApplicationEngine::objectCreated, this, &DiscoverMainWindow::integrateObject);
......
......@@ -29,6 +29,7 @@ class AbstractResource;
class Category;
class QWindow;
class QQmlApplicationEngine;
class CachedNetworkAccessManagerFactory;
class DiscoverMainWindow : public QObject
{
......@@ -97,6 +98,7 @@ class DiscoverMainWindow : public QObject
QQmlApplicationEngine * const m_engine;
CompactMode m_mode;
QScopedPointer<CachedNetworkAccessManagerFactory> m_networkAccessManagerFactory;
};
#endif // MUONINSTALLERDECLARATIVEVIEW_H
Markdown is supported
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