diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2016-05-19 09:37:22 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-05-20 06:08:57 +0000 |
commit | a1dccd0708ae805b014489b5b16cc055d3001c50 (patch) | |
tree | eb3d5ee01b1cbcec9a4fd540d27c75424303d2be /src | |
parent | eba979f6956f8d74bf5a3cb6ed0d585396b790f1 (diff) |
WinRT: Do not assert on socket close
If no read was established before (no IO pending) the function
will fail. In this case there is no need to assert though.
Change-Id: Iaa18e4124389783fc2b8363a85c60a308903a713
Task-number: QTBUG-53424
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/socket/qnativesocketengine_winrt.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index ecd364b84b..aae0dd835b 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -469,7 +469,10 @@ void QNativeSocketEngine::close() hr = socket3->CancelIOAsync(&action); Q_ASSERT_SUCCEEDED(hr); hr = QWinRTFunctions::await(action); - Q_ASSERT_SUCCEEDED(hr); + // If there is no pending IO (no read established before) the function will fail with + // "function was called at an unexpected time" which is fine. + if (hr != E_ILLEGAL_METHOD_CALL) + Q_ASSERT_SUCCEEDED(hr); } #endif // _MSC_VER >= 1900 |