[pim/kleopatra] src/utils: Don't leak export jobs when dragging & dropping keys

Ingo Klöcker <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit ce6407c315500494eefe6eb4b9793e9e2bf3a565 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 29/07/2026 at 10:07.
Pushed by kloecker into branch 'master'.

Don't leak export jobs when dragging & dropping keys

M  +3    -2    src/utils/keyexportdraghandler.cpp

https://invent.kde.org/pim/kleopatra/-/commit/ce6407c315500494eefe6eb4b9793e9e2bf3a565

diff --git a/src/utils/keyexportdraghandler.cpp b/src/utils/keyexportdraghandler.cpp
index 3622de60e..a5cde7ad6 100644
--- a/src/utils/keyexportdraghandler.cpp
+++ b/src/utils/keyexportdraghandler.cpp
@@ -5,6 +5,7 @@
 
 #include <kleopatraapplication.h>
 
+#include <utils/memory-helpers.h>
 #include <utils/path-helper.h>
 
 #include "kleopatra_debug.h"
@@ -49,11 +50,11 @@ public:
         Q_UNUSED(type);
 
         if (pgpData.isEmpty() && !pgpFprs.isEmpty()) {
-            auto job = QGpgME::openpgp()->publicKeyExportJob(true);
+            const auto job = wrap_unique(QGpgME::openpgp()->publicKeyExportJob(true));
             job->exec(pgpFprs, pgpData);
         }
         if (smimeData.isEmpty() && !smimeFprs.isEmpty()) {
-            auto job = QGpgME::smime()->publicKeyExportJob(true);
+            const auto job = wrap_unique(QGpgME::smime()->publicKeyExportJob(true));
             job->exec(smimeFprs, smimeData);
         }
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.