mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #4795 from sepalani/fix_sock
Fixes a crash when closing a socket
This commit is contained in:
commit
5b782b9f2d
@ -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
Block a user