aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libui_sdl/LAN_Socket.cpp12
-rw-r--r--src/libui_sdl/Platform.cpp10
-rw-r--r--src/libui_sdl/main.cpp4
3 files changed, 20 insertions, 6 deletions
diff --git a/src/libui_sdl/LAN_Socket.cpp b/src/libui_sdl/LAN_Socket.cpp
index 9da5769..2aede4d 100644
--- a/src/libui_sdl/LAN_Socket.cpp
+++ b/src/libui_sdl/LAN_Socket.cpp
@@ -124,7 +124,17 @@ bool Init()
void DeInit()
{
- // TODO CLEANUP SHIT!!!!
+ for (int i = 0; i < (sizeof(TCPSocketList)/sizeof(TCPSocket)); i++)
+ {
+ TCPSocket* sock = &TCPSocketList[i];
+ if (sock->Backend) closesocket(sock->Backend);
+ }
+
+ for (int i = 0; i < (sizeof(UDPSocketList)/sizeof(UDPSocket)); i++)
+ {
+ UDPSocket* sock = &UDPSocketList[i];
+ if (sock->Backend) closesocket(sock->Backend);
+ }
}
diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp
index f5ec32e..20b4a03 100644
--- a/src/libui_sdl/Platform.cpp
+++ b/src/libui_sdl/Platform.cpp
@@ -279,10 +279,12 @@ bool LAN_Init()
void LAN_DeInit()
{
// checkme. blarg
- if (Config::DirectLAN)
- LAN_PCap::DeInit();
- else
- LAN_Socket::DeInit();
+ //if (Config::DirectLAN)
+ // LAN_PCap::DeInit();
+ //else
+ // LAN_Socket::DeInit();
+ LAN_PCap::DeInit();
+ LAN_Socket::DeInit();
}
int LAN_SendPacket(u8* data, int len)
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index 25c7249..e4ac78a 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -632,6 +632,7 @@ int EmuThreadFunc(void* burp)
if (joybuttons) delete[] joybuttons;
NDS::DeInit();
+ Platform::LAN_DeInit();
return 44203;
}
@@ -1679,7 +1680,8 @@ void ApplyNewSettings(int type)
Platform::MP_Init();
}
- // TODO: cycle LAN shito
+ Platform::LAN_DeInit();
+ Platform::LAN_Init();
}
EmuRunning = prevstatus;