diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-09-11 11:14:04 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-09-11 12:48:35 +0200 |
commit | 4babd9b2f1ba1d8c8c58c2f728cc4875ecf144c7 (patch) | |
tree | 852b81483faa42cda96523383204e9ca60cb2e38 /lib | |
parent | 2bf18a64d236c2364e12d4c2f1a9464cc6a2ebf9 (diff) | |
download | libquotient-4babd9b2f1ba1d8c8c58c2f728cc4875ecf144c7.tar.gz libquotient-4babd9b2f1ba1d8c8c58c2f728cc4875ecf144c7.zip |
Don't parent NAM to QCoreApplication
QThreadStorage accepts ownership over stored objects.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/networkaccessmanager.cpp | 4 |
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()); } |