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>
This commit is contained in:
parent
eba979f695
commit
a1dccd0708
@ -469,6 +469,9 @@ void QNativeSocketEngine::close()
|
|||||||
hr = socket3->CancelIOAsync(&action);
|
hr = socket3->CancelIOAsync(&action);
|
||||||
Q_ASSERT_SUCCEEDED(hr);
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
hr = QWinRTFunctions::await(action);
|
hr = QWinRTFunctions::await(action);
|
||||||
|
// 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);
|
Q_ASSERT_SUCCEEDED(hr);
|
||||||
}
|
}
|
||||||
#endif // _MSC_VER >= 1900
|
#endif // _MSC_VER >= 1900
|
||||||
|
Loading…
x
Reference in New Issue
Block a user