[frameworks/kguiaddons] src/systemclipboard: waylandclipboard: Properly clean up device and manager

David Redondo <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 16775a41f7f74bfaa4aa7fb9bf62e6aabbfc60f7 by David Redondo.
Committed on 21/07/2026 at 09:57.
Pushed by davidre into branch 'master'.

waylandclipboard: Properly clean up device and manager

Destroy the wayland object of the manager when the global vanishes.
Also only destroy the objects when we know the the thread is not running
anymore.

M  +2    -1    src/systemclipboard/waylandclipboard.cpp

https://invent.kde.org/frameworks/kguiaddons/-/commit/16775a41f7f74bfaa4aa7fb9bf62e6aabbfc60f7

diff --git a/src/systemclipboard/waylandclipboard.cpp b/src/systemclipboard/waylandclipboard.cpp
index a2f2c53..28f3c79 100644
--- a/src/systemclipboard/waylandclipboard.cpp
+++ b/src/systemclipboard/waylandclipboard.cpp
@@ -617,9 +617,10 @@ WaylandClipboard::WaylandClipboard(QObject *parent)
             m_thread->start();
 
         } else {
-            m_device.reset();
             m_thread->requestInterruption();
             m_thread->wait();
+            m_device.reset();
+            m_manager->destroy();
             m_thread.reset();
         }
     });
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.