[utilities/kate/release/26.08] addons/kategpgplugin: gpgplugin: fix memory leak

Christoph Cullmann <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 3a57ebb547485144d1117ad8ab16b1de61ef3187 by Christoph Cullmann.
Committed on 16/07/2026 at 17:18.
Pushed by cullmann into branch 'release/26.08'.

gpgplugin: fix memory leak


(cherry picked from commit 12d263583875953bd551af1eb64e4dd1b98eb9f6)

Co-authored-by: leia uwu <[email protected]>

M  +1    -1    addons/kategpgplugin/kategpgplugin.cpp
M  +1    -1    addons/kategpgplugin/kategpgplugin.hpp

https://invent.kde.org/utilities/kate/-/commit/3a57ebb547485144d1117ad8ab16b1de61ef3187

diff --git a/addons/kategpgplugin/kategpgplugin.cpp b/addons/kategpgplugin/kategpgplugin.cpp
index a0055e17c8..37ba51a0a8 100644
--- a/addons/kategpgplugin/kategpgplugin.cpp
+++ b/addons/kategpgplugin/kategpgplugin.cpp
@@ -61,7 +61,7 @@ KateGPGPluginView::KateGPGPluginView(KateGPGPlugin *plugin, KTextEditor::MainWin
     : m_mainWindow(mainwindow)
     , m_plugin(plugin)
 {
-    m_gpgWrapper = new GPGMeWrapper();
+    m_gpgWrapper = std::make_unique<GPGMeWrapper>();
     m_toolview.reset(m_mainWindow->createToolView(plugin, // pointer to plugin
                                                   QStringLiteral("gpgPlugin"), // just an identifier for the toolview
                                                   KTextEditor::MainWindow::Left, // we want to create a toolview on the
diff --git a/addons/kategpgplugin/kategpgplugin.hpp b/addons/kategpgplugin/kategpgplugin.hpp
index 09cd57c95a..4cf0c10996 100644
--- a/addons/kategpgplugin/kategpgplugin.hpp
+++ b/addons/kategpgplugin/kategpgplugin.hpp
@@ -86,7 +86,7 @@ private:
     // The top level toolview widget
     std::unique_ptr<QWidget> m_toolview;
 
-    GPGMeWrapper *m_gpgWrapper = nullptr;
+    std::unique_ptr<GPGMeWrapper> m_gpgWrapper;
 
     int m_selectedRowIndex = 0;
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.