diff --git a/desmume/src/frontend/windows/main.cpp b/desmume/src/frontend/windows/main.cpp index 2be481052..98f0885f9 100755 --- a/desmume/src/frontend/windows/main.cpp +++ b/desmume/src/frontend/windows/main.cpp @@ -3557,6 +3557,11 @@ int _main() gdbstub_mutex_destroy(); #endif + if (wifiHandler->IsSocketsSupported()) + { + WSACleanup(); + } + NDS_DeInit(); #ifdef DEBUG @@ -3591,11 +3596,6 @@ int _main() UnregWndClass("DeSmuME"); - if (wifiHandler->IsSocketsSupported()) - { - WSACleanup(); - } - return 0; }