[plasma/plasma-nm/Plasma/6.7] kded: Use dynamically allocated DeletePasswordJob
Matthias Kurz <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 43361d5566c1ac806db960866a47d0cd959ca04a by Matthias Kurz, on behalf of Mickaël Thomas.
Committed on 17/08/2026 at 07:44.
Pushed by ngraham into branch 'Plasma/6.7'.
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/43361d5566c1ac806db960866a47d0cd959ca04a
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;