diff --git a/src/plugins/perfprofiler/perfdatareader.cpp b/src/plugins/perfprofiler/perfdatareader.cpp index 68aa56c9621..3cfb7c2989c 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); } }