forked from qt-creator/qt-creator
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:
@@ -351,8 +351,10 @@ void PerfDataReader::writeChunk()
|
|||||||
"Your trace is incomplete."));
|
"Your trace is incomplete."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (m_dataFinished) {
|
} else if (m_dataFinished && m_input.isWritable()) {
|
||||||
m_input.closeWriteChannel();
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user