From 5ec80a554c0362117a01df238f14d7036a58f1e0 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Sun, 6 Oct 2019 18:43:01 +0400 Subject: [PATCH] Socket: Abort pending operations on close --- Source/Core/Core/IOS/Network/Socket.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/IOS/Network/Socket.cpp b/Source/Core/Core/IOS/Network/Socket.cpp index d7464acc4f..a2b081bd5d 100644 --- a/Source/Core/Core/IOS/Network/Socket.cpp +++ b/Source/Core/Core/IOS/Network/Socket.cpp @@ -170,6 +170,12 @@ s32 WiiSocket::CloseFd() ReturnValue = WiiSockMan::GetNetErrorCode(EITHER(WSAENOTSOCK, EBADF), "CloseFd", false); } fd = -1; + + for (auto it = pending_sockops.begin(); it != pending_sockops.end();) + { + GetIOS()->EnqueueIPCReply(it->request, -SO_ENOTCONN); + it = pending_sockops.erase(it); + } return ReturnValue; }