[pim/kleopatra/release/26.08] 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 3dfa58209cf2604f3d19b02a1d99b6474a542f95 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 29/07/2026 at 12:06.
Pushed by kloecker into branch 'release/26.08'.

Don't leak export jobs when dragging & dropping keys

(cherry picked from commit ce6407c315500494eefe6eb4b9793e9e2bf3a565)

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

https://invent.kde.org/pim/kleopatra/-/commit/3dfa58209cf2604f3d19b02a1d99b6474a542f95

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.