summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network/socket/qlocalsocket_win.cpp3
-rw-r--r--tests/auto/qlocalsocket/tst_qlocalsocket.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/network/socket/qlocalsocket_win.cpp b/src/network/socket/qlocalsocket_win.cpp
index aa597daa1f..2223ebe9da 100644
--- a/src/network/socket/qlocalsocket_win.cpp
+++ b/src/network/socket/qlocalsocket_win.cpp
@@ -252,6 +252,9 @@ void QLocalSocketPrivate::startAsyncRead()
{
do {
DWORD bytesToRead = checkPipeState();
+ if (pipeClosed)
+ return;
+
if (bytesToRead == 0) {
// There are no bytes in the pipe but we need to
// start the overlapped read with some buffer size.
diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
index 87a30c2186..d2cba6ecb5 100644
--- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp
@@ -1004,7 +1004,7 @@ void tst_QLocalSocket::writeToClientAndDisconnect()
timeout -= timestep;
} while (!readChannelFinishedSpy.count() && timeout > 0);
- QVERIFY(!readChannelFinishedSpy.isEmpty());
+ QCOMPARE(readChannelFinishedSpy.count(), 1);
QCOMPARE(client.read(buffer, sizeof(buffer)), (qint64)sizeof(buffer));
QCOMPARE(client.state(), QLocalSocket::UnconnectedState);
}