QLocalSocket/Win: Fix access to deleted pipeWriter

waitForWrite can emit a signal outside QLocalSocket and pipeWriter
could be deleted there.

Change-Id: Ic35ec6455bd05402fd38fb3e1b219aa4534a0ff6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
bb10
Aleksei Timofeyev 2016-04-22 17:00:27 +05:00 committed by Joerg Bornemann
parent ecf025f613
commit 4d7313a466
1 changed files with 2 additions and 4 deletions

View File

@ -309,10 +309,8 @@ bool QLocalSocket::flush()
{
Q_D(QLocalSocket);
bool written = false;
if (d->pipeWriter) {
while (d->pipeWriter->waitForWrite(0))
written = true;
}
while (d->pipeWriter && d->pipeWriter->waitForWrite(0))
written = true;
return written;
}