QLocalSocket/Win: fix possible UB in _q_pipeClosed()
We must stop the pipe writer before closing the handle on which it operates. Change-Id: I4765dd8393167fe2453653aba76a097b8ace8e3d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 64f02ebf05d88eaa8399a5cff85db5a605ede62e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4e15494dad
commit
fe979a809f
@ -260,13 +260,10 @@ void QLocalSocketPrivate::_q_pipeClosed()
|
|||||||
emit q->disconnected();
|
emit q->disconnected();
|
||||||
|
|
||||||
pipeReader->stop();
|
pipeReader->stop();
|
||||||
|
delete pipeWriter;
|
||||||
|
pipeWriter = nullptr;
|
||||||
destroyPipeHandles();
|
destroyPipeHandles();
|
||||||
handle = INVALID_HANDLE_VALUE;
|
handle = INVALID_HANDLE_VALUE;
|
||||||
|
|
||||||
if (pipeWriter) {
|
|
||||||
delete pipeWriter;
|
|
||||||
pipeWriter = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 QLocalSocket::bytesAvailable() const
|
qint64 QLocalSocket::bytesAvailable() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user