Debugger: Fix out of memory crash when receiving regular output

Change-Id: Icda28ec56c191e62812a4e5219a1df902c5e60a1
Fixes: QTCREATORBUG-22733
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-10-08 06:38:27 +02:00
parent ea829fa6d5
commit 5b127dd088

View File

@@ -552,8 +552,14 @@ void LogWindow::showOutput(int channel, const QString &output)
out.append(nchar);
m_queuedOutput.append(out);
m_outputTimer.setSingleShot(true);
m_outputTimer.start(80);
// flush the output if it exceeds 16k to prevent out of memory exceptions on regular output
if (m_queuedOutput.size() > 16 * 1024) {
m_outputTimer.stop();
doOutput();
} else {
m_outputTimer.setSingleShot(true);
m_outputTimer.start(80);
}
}
void LogWindow::doOutput()