QLocalSocket/Win: fix possible UB in _q_pipeClosed()

We must stop the pipe writer before closing the handle on which it
operates.

Pick-to: 5.15 6.0 6.1
Change-Id: I4765dd8393167fe2453653aba76a097b8ace8e3d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
Alex Trotsenko 2021-03-31 18:01:01 +03:00
parent 97877d7948
commit 64f02ebf05

View File

@ -260,13 +260,10 @@ void QLocalSocketPrivate::_q_pipeClosed()
emit q->disconnected();
pipeReader->stop();
delete pipeWriter;
pipeWriter = nullptr;
destroyPipeHandles();
handle = INVALID_HANDLE_VALUE;
if (pipeWriter) {
delete pipeWriter;
pipeWriter = 0;
}
}
qint64 QLocalSocket::bytesAvailable() const