[network/neochat] src/app: Fix memory leak

Tobias Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 63baf485fdef8cb976fea27c3222f5e9448f6740 by Tobias Fella.
Committed on 26/07/2026 at 14:05.
Pushed by tfella into branch 'master'.

Fix memory leak

M  +2    -1    src/app/main.cpp

https://invent.kde.org/network/neochat/-/commit/63baf485fdef8cb976fea27c3222f5e9448f6740

diff --git a/src/app/main.cpp b/src/app/main.cpp
index 55ab28a89..a8d5cdbfb 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -271,7 +271,8 @@ int main(int argc, char *argv[])
 #endif
 
     KLocalization::setupLocalizedContext(&engine);
-    engine.setNetworkAccessManagerFactory(new NetworkAccessManagerFactory());
+    NetworkAccessManagerFactory networkAccessManagerFactory;
+    engine.setNetworkAccessManagerFactory(&networkAccessManagerFactory);
 
     if (parser.isSet("ignore-ssl-errors"_L1)) {
         QObject::connect(NetworkAccessManager::instance(), &QNetworkAccessManager::sslErrors, NetworkAccessManager::instance(), [](QNetworkReply *reply) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.