diff --git a/abstract_backend.cpp b/abstract_backend.cpp index b1b477882c..566dd78396 100644 --- a/abstract_backend.cpp +++ b/abstract_backend.cpp @@ -95,6 +95,12 @@ void AbstractBackend::updateCursorImage(Qt::CursorShape shape) // check whether we can create it if (waylandServer() && waylandServer()->internalShmPool()) { m_cursorTheme = new WaylandCursorTheme(waylandServer()->internalShmPool(), this); + connect(waylandServer(), &WaylandServer::terminatingInternalClientConnection, this, + [this] { + delete m_cursorTheme; + m_cursorTheme = nullptr; + } + ); } } if (!m_cursorTheme) {