diff --git a/plugins/platforms/drm/drm_output.cpp b/plugins/platforms/drm/drm_output.cpp --- a/plugins/platforms/drm/drm_output.cpp +++ b/plugins/platforms/drm/drm_output.cpp @@ -65,7 +65,7 @@ void DrmOutput::teardown() { if (m_deleted) { - return; + return ; } m_deleted = true; hideCursor(); @@ -80,12 +80,14 @@ } m_primaryPlane->setCurrent(nullptr); } + if (m_cursorPlane) { + m_cursorPlane->setOutput(nullptr); + } m_crtc->setOutput(nullptr); m_conn->setOutput(nullptr); - delete m_cursor[0]; - delete m_cursor[1]; + delete[] m_cursor; if (!m_pageFlipPending) { deleteLater(); } //else will be deleted in the page flip handler @@ -166,6 +168,9 @@ void DrmOutput::updateCursor() { + if (m_deleted) { + return ; + } QImage cursorImage = Cursors::self()->currentCursor()->image(); if (cursorImage.isNull()) { return;