aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-11 11:14:04 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-09-11 12:48:35 +0200
commit4babd9b2f1ba1d8c8c58c2f728cc4875ecf144c7 (patch)
tree852b81483faa42cda96523383204e9ca60cb2e38
parent2bf18a64d236c2364e12d4c2f1a9464cc6a2ebf9 (diff)
downloadlibquotient-4babd9b2f1ba1d8c8c58c2f728cc4875ecf144c7.tar.gz
libquotient-4babd9b2f1ba1d8c8c58c2f728cc4875ecf144c7.zip
Don't parent NAM to QCoreApplication
QThreadStorage accepts ownership over stored objects.
-rw-r--r--lib/networkaccessmanager.cpp4
1 files changed, 1 insertions, 3 deletions
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<NetworkAccessManager*> storage;
- // FIXME: createNam() returns an object parented to
- // QCoreApplication::instance() that lives in the main thread
if(!storage.hasLocalData()) {
storage.setLocalData(createNam());
}