Fixes a crash when closing a socket
This commit is contained in:
parent
1603191145
commit
3fd08b6cee
|
@ -615,9 +615,13 @@ s32 WiiSockMan::NewSocket(s32 af, s32 type, s32 protocol)
|
|||
|
||||
s32 WiiSockMan::DeleteSocket(s32 s)
|
||||
{
|
||||
s32 ReturnValue = EBADF;
|
||||
auto socket_entry = WiiSockets.find(s);
|
||||
s32 ReturnValue = socket_entry->second.CloseFd();
|
||||
WiiSockets.erase(socket_entry);
|
||||
if (socket_entry != WiiSockets.end())
|
||||
{
|
||||
ReturnValue = socket_entry->second.CloseFd();
|
||||
WiiSockets.erase(socket_entry);
|
||||
}
|
||||
return ReturnValue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue