[plasma/plasma-nm] kded: Use dynamically allocated DeletePasswordJob

Marco Martin <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 058e7d11bb4d54e0f0402f9b6fa915f4f10a3e79 by Marco Martin, on behalf of Mickaël Thomas.
Committed on 10/08/2026 at 10:48.
Pushed by mart into branch 'master'.

Use dynamically allocated DeletePasswordJob

If allocated on the stack, the job is immediately deleted and the
callback is never executed

M  +4    -4    kded/secretagent.cpp

https://invent.kde.org/plasma/plasma-nm/-/commit/058e7d11bb4d54e0f0402f9b6fa915f4f10a3e79

diff --git a/kded/secretagent.cpp b/kded/secretagent.cpp
index b548e478d..ac30f472b 100644
--- a/kded/secretagent.cpp
+++ b/kded/secretagent.cpp
@@ -553,16 +553,16 @@ bool SecretAgent::processDeleteSecrets(QSharedPointer<SecretsRequest> request)
         }
         for (const NetworkManager::Setting::Ptr &setting : connectionSettings.settings()) {
             auto jobRequest = request.toWeakRef();
-            QKeychain::DeletePasswordJob job(QString::fromLatin1(keychainService));
-            connect(&job, &QKeychain::Job::finished, this, [this, jobRequest] {
+            auto *job = new QKeychain::DeletePasswordJob(QString::fromLatin1(keychainService));
+            connect(job, &QKeychain::Job::finished, this, [this, jobRequest] {
                 auto request = jobRequest.toStrongRef();
                 if (!request)
                     return;
                 --request->storageJobsRunning;
                 processNext();
             });
-            job.setKey(storageKey(connectionSettings, setting->name()));
-            job.start();
+            job->setKey(storageKey(connectionSettings, setting->name()));
+            job->start();
             ++request->storageJobsRunning;
             request->storageJobsStarted = true;
             return false;
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.