diff --git a/Modules/base/info_wayland.h b/Modules/base/info_wayland.h --- a/Modules/base/info_wayland.h +++ b/Modules/base/info_wayland.h @@ -29,6 +29,7 @@ namespace KWayland { namespace Client { class ConnectionThread; + class Registry; } } @@ -44,6 +45,7 @@ QTreeWidget *m_tree; QThread *m_thread; KWayland::Client::ConnectionThread *m_connection; + KWayland::Client::Registry *m_registry = nullptr; }; #endif // INFO_WAYLAND_H diff --git a/Modules/base/info_wayland.cpp b/Modules/base/info_wayland.cpp --- a/Modules/base/info_wayland.cpp +++ b/Modules/base/info_wayland.cpp @@ -42,6 +42,7 @@ WaylandModule::~WaylandModule() { + delete m_registry; m_connection->deleteLater(); m_thread->quit(); m_thread->wait(); @@ -68,7 +69,7 @@ connect(m_connection, &ConnectionThread::connected, this, [this, compositorItem, interfacesItem] { Registry *registry = new Registry(this); - EventQueue *queue = new EventQueue(this); + EventQueue *queue = new EventQueue(registry); queue->setup(m_connection); registry->setEventQueue(queue); connect(registry, &Registry::interfaceAnnounced, this, @@ -215,6 +216,7 @@ ); } ); + m_registry = registry; registry->create(m_connection); registry->setup(); },