diff options
author | David Schulz <david.schulz@qt.io> | 2019-10-08 06:38:27 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2019-10-08 06:19:05 +0000 |
commit | 5b127dd088b93f1ec8fc88966e015aaf40f6a4b4 (patch) | |
tree | 1c7e4a1d1c053a217a5fd28e4216da894c499d10 | |
parent | ea829fa6d51b46d1c2f06d14150c0948ffd044d5 (diff) | |
download | qt-creator-5b127dd088b93f1ec8fc88966e015aaf40f6a4b4.tar.gz |
Debugger: Fix out of memory crash when receiving regular output
Change-Id: Icda28ec56c191e62812a4e5219a1df902c5e60a1
Fixes: QTCREATORBUG-22733
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | src/plugins/debugger/logwindow.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp index e671709161..1c5d9fd487 100644 --- a/src/plugins/debugger/logwindow.cpp +++ b/src/plugins/debugger/logwindow.cpp @@ -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() |