forked from qt-creator/qt-creator
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:
@@ -552,8 +552,14 @@ void LogWindow::showOutput(int channel, const QString &output)
|
|||||||
out.append(nchar);
|
out.append(nchar);
|
||||||
|
|
||||||
m_queuedOutput.append(out);
|
m_queuedOutput.append(out);
|
||||||
m_outputTimer.setSingleShot(true);
|
// flush the output if it exceeds 16k to prevent out of memory exceptions on regular output
|
||||||
m_outputTimer.start(80);
|
if (m_queuedOutput.size() > 16 * 1024) {
|
||||||
|
m_outputTimer.stop();
|
||||||
|
doOutput();
|
||||||
|
} else {
|
||||||
|
m_outputTimer.setSingleShot(true);
|
||||||
|
m_outputTimer.start(80);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWindow::doOutput()
|
void LogWindow::doOutput()
|
||||||
|
Reference in New Issue
Block a user