[wayland] Delete cursor theme when internal connection terminates
Fixes a use-after-free reported by ASAN.
This commit is contained in:
parent
a0cc3aac63
commit
3ea4f161cf
1 changed files with 6 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue