diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-12 14:20:18 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-02-12 13:44:36 +0000 |
commit | 24c7a51811151588d9547202540c4be3a79431f4 (patch) | |
tree | 394f9850fe6e65c3a1e69f2c78bfacf32620956e /src/plugins/perfprofiler | |
parent | 94425336fd29c9715aec10318e30b18ac8ba75ea (diff) | |
download | qt-creator-24c7a51811151588d9547202540c4be3a79431f4.tar.gz |
PerfProfiler: Delay closing of perfparser's write channel
We don't want to do this from writeChunk() as that is directly connected
to QProcess::bytesWritten. closeWriteChannel() can delete the
QWindowsPipeWriter from which the bytesWritten signal originates, crashing
the event loop when it tries to resolve further receivers for the same
signal.
Change-Id: I66737572a33db364f0f61542343f0fc8dc696787
Task-number: QTCREATORBUG-21971
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/perfprofiler')
-rw-r--r-- | src/plugins/perfprofiler/perfdatareader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp index 68aa56c962..3cfb7c2989 100644 --- a/src/plugins/perfprofiler/perfdatareader.cpp +++ b/src/plugins/perfprofiler/perfdatareader.cpp @@ -351,8 +351,10 @@ void PerfDataReader::writeChunk() "Your trace is incomplete.")); } } - } else if (m_dataFinished) { - m_input.closeWriteChannel(); + } else if (m_dataFinished && m_input.isWritable()) { + // Delay closing of the write channel. Closing the channel from within a handler + // for bytesWritten() is dangerous on windows. + QTimer::singleShot(0, &m_input, &QProcess::closeWriteChannel); } } |