[wayland] Delete cursor theme when internal connection terminates

Fixes a use-after-free reported by ASAN.
icc-effect-5.14.5
Martin Gräßlin 2016-02-02 16:40:21 +01:00
parent a0cc3aac63
commit 3ea4f161cf
1 changed files with 6 additions and 0 deletions

View File

@ -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) {