From 4babd9b2f1ba1d8c8c58c2f728cc4875ecf144c7 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 11 Sep 2021 11:14:04 +0200 Subject: Don't parent NAM to QCoreApplication QThreadStorage accepts ownership over stored objects. --- lib/networkaccessmanager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/networkaccessmanager.cpp') diff --git a/lib/networkaccessmanager.cpp b/lib/networkaccessmanager.cpp index 3b0dc92b..d35b2ec8 100644 --- a/lib/networkaccessmanager.cpp +++ b/lib/networkaccessmanager.cpp @@ -59,7 +59,7 @@ void NetworkAccessManager::clearIgnoredSslErrors() static NetworkAccessManager* createNam() { - auto nam = new NetworkAccessManager(QCoreApplication::instance()); + auto nam = new NetworkAccessManager(); #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) // See #109; in newer Qt, bearer management is deprecated altogether NetworkAccessManager::connect(nam, @@ -73,8 +73,6 @@ static NetworkAccessManager* createNam() NetworkAccessManager* NetworkAccessManager::instance() { static QThreadStorage storage; - // FIXME: createNam() returns an object parented to - // QCoreApplication::instance() that lives in the main thread if(!storage.hasLocalData()) { storage.setLocalData(createNam()); } -- cgit v1.2.3