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>
This commit is contained in:
Ulf Hermann
2019-02-12 14:20:18 +01:00
parent 94425336fd
commit 24c7a51811

View File

@@ -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);
}
}