From 24c7a51811151588d9547202540c4be3a79431f4 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 12 Feb 2019 14:20:18 +0100 Subject: 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 --- src/plugins/perfprofiler/perfdatareader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/perfprofiler') 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); } } -- cgit v1.2.1