Avoid crash in KWin on Session leave

BUG: 420077

- hunk of original commit e8a1f8ecc seems was lost during a94be708e merge,
so restoring it again
- add missing check

Original Differential Revision: https://phabricator.kde.org/D28889
master
Andrey Butirsky 2020-07-28 19:48:57 +03:00 committed by David Edmundson
parent d71672a0d1
commit 307a9bc559
1 changed files with 7 additions and 0 deletions

View File

@ -118,6 +118,10 @@ bool DrmOutput::showCursor(DrmDumbBuffer *c)
bool DrmOutput::showCursor() bool DrmOutput::showCursor()
{ {
if (m_deleted) {
return false;
}
if (Q_UNLIKELY(m_backend->usesSoftwareCursor())) { if (Q_UNLIKELY(m_backend->usesSoftwareCursor())) {
qCCritical(KWIN_DRM) << "DrmOutput::showCursor should never be called when software cursor is enabled"; qCCritical(KWIN_DRM) << "DrmOutput::showCursor should never be called when software cursor is enabled";
return true; return true;
@ -174,6 +178,9 @@ QMatrix4x4 DrmOutput::matrixDisplay(const QSize &s) const
void DrmOutput::updateCursor() void DrmOutput::updateCursor()
{ {
if (m_deleted) {
return;
}
QImage cursorImage = Cursors::self()->currentCursor()->image(); QImage cursorImage = Cursors::self()->currentCursor()->image();
if (cursorImage.isNull()) { if (cursorImage.isNull()) {
return; return;