From f00ed7738de8216cfe8fa30519ea495dc18cf024 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Fri, 31 Jul 2026 16:34:33 +0200 Subject: [PATCH] kate: fix crash in onSessionKilled QTextDocument::setHtml was called while the document was still tearing down from clear(). Defer refreshSessions to the next event loop iteration with QTimer::singleShot(0, ...). --- kate/ollie_kate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kate/ollie_kate.cpp b/kate/ollie_kate.cpp index a104be0..fa7b219 100644 --- a/kate/ollie_kate.cpp +++ b/kate/ollie_kate.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -524,7 +525,10 @@ void OllieKateView::onSessionKilled(const QString &session_id) m_chatView->clear(); m_sessionLabel->setText("No session"); m_cwdLabel->setText(""); - refreshSessions(); + // Defer session switch to let Qt finish processing the D-Bus signal. + // Calling render() synchronously here can crash because the QTextDocument + // is still tearing down resources from the clear() above. + QTimer::singleShot(0, this, &OllieKateView::refreshSessions); } }