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, ...).
This commit is contained in:
parent
5dfdd2bd31
commit
f00ed7738d
|
|
@ -28,6 +28,7 @@
|
|||
#include <QFileInfo>
|
||||
#include <QInputDialog>
|
||||
#include <QScrollBar>
|
||||
#include <QTimer>
|
||||
#include <QCheckBox>
|
||||
#include <QSet>
|
||||
#include <QFormLayout>
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in New Issue