forked from qt-creator/qt-creator
Debugger: Prevent crash on shutdown
It may happen that the global log window gets destroyed before the log windows of a running engine when QC is closed after an unsuccessful attempt to debug. Avoid accessing it when trying to write output that has not been processed so far. Change-Id: I41296cc37bab1e4f1272b05dda1979d813981aa7 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -567,7 +567,8 @@ void LogWindow::doOutput()
|
||||
if (m_queuedOutput.isEmpty())
|
||||
return;
|
||||
|
||||
theGlobalLog->doOutput(m_queuedOutput);
|
||||
if (theGlobalLog)
|
||||
theGlobalLog->doOutput(m_queuedOutput);
|
||||
|
||||
QTextCursor cursor = m_combinedText->textCursor();
|
||||
const bool atEnd = cursor.atEnd();
|
||||
@@ -706,6 +707,7 @@ GlobalLogWindow::GlobalLogWindow()
|
||||
|
||||
GlobalLogWindow::~GlobalLogWindow()
|
||||
{
|
||||
theGlobalLog = nullptr;
|
||||
}
|
||||
|
||||
void GlobalLogWindow::doOutput(const QString &output)
|
||||
|
Reference in New Issue
Block a user