diff --git a/src/internalwindow.cpp b/src/internalwindow.cpp index db4b6d167d..ae783d455b 100644 --- a/src/internalwindow.cpp +++ b/src/internalwindow.cpp @@ -335,6 +335,7 @@ void InternalWindow::destroyWindow() Q_EMIT closed(); + setTile(nullptr); workspace()->removeInternalWindow(this); m_handle = nullptr; diff --git a/src/window.cpp b/src/window.cpp index 4c0844a578..ce2435333f 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -101,9 +101,7 @@ Window::Window() Window::~Window() { - if (m_tile) { - m_tile->removeWindow(this); - } + Q_ASSERT(!m_tile); Q_ASSERT(m_blockGeometryUpdates == 0); } @@ -3611,6 +3609,7 @@ void Window::setTile(Tile *tile) m_tile = tile; if (m_tile) { + Q_ASSERT(!isDeleted()); m_tile->addWindow(this); } diff --git a/src/x11window.cpp b/src/x11window.cpp index 6b3776d7ce..ca748833c0 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -407,6 +407,7 @@ void X11Window::releaseWindow(bool on_shutdown) if (isInteractiveMoveResize()) { Q_EMIT interactiveMoveResizeFinished(); } + setTile(nullptr); workspace()->rulebook()->discardUsed(this, true); // Remove ForceTemporarily rules StackingUpdatesBlocker blocker(workspace()); stopDelayedInteractiveMoveResize(); @@ -485,6 +486,7 @@ void X11Window::destroyWindow() if (isInteractiveMoveResize()) { Q_EMIT interactiveMoveResizeFinished(); } + setTile(nullptr); workspace()->rulebook()->discardUsed(this, true); // Remove ForceTemporarily rules StackingUpdatesBlocker blocker(workspace()); stopDelayedInteractiveMoveResize(); diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 6b13df5b1f..ef92707ffc 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -300,6 +300,7 @@ void XdgSurfaceWindow::destroyWindow() leaveInteractiveMoveResize(); Q_EMIT interactiveMoveResizeFinished(); } + setTile(nullptr); m_configureTimer->stop(); qDeleteAll(m_configureEvents); m_configureEvents.clear();