QLocalSocket/Win: remove dead code in disconnectFromServer()

The _q_pipeClosed() slot unconditionally removes the pipeWriter just
before closing the pipe. Thus, if we have an invalid handle here,
the pipe writer has already been destroyed anyway.

Change-Id: I57463d8464afe6141c21a63851a56ebddabd3f13
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
bb10
Alex Trotsenko 2021-07-21 20:06:20 +03:00
parent d9c0af92bd
commit 719116db3d
1 changed files with 0 additions and 8 deletions

View File

@ -407,14 +407,6 @@ void QLocalSocket::disconnectFromServer()
{
Q_D(QLocalSocket);
// Are we still connected?
if (!isValid()) {
// If we have unwritten data, the pipeWriter is still present.
// It must be destroyed before close() to prevent an infinite loop.
delete d->pipeWriter;
d->pipeWriter = 0;
}
flush();
if (bytesToWrite() != 0) {
d->state = QLocalSocket::ClosingState;