mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
fix OpenGL deinit when closing emu
This commit is contained in:
@ -1049,6 +1049,12 @@ int EmuThreadFunc(void* burp)
|
|||||||
return 44203;
|
return 44203;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StopEmuThread()
|
||||||
|
{
|
||||||
|
EmuRunning = 0;
|
||||||
|
SDL_WaitThread(EmuThread, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void OnAreaDraw(uiAreaHandler* handler, uiArea* area, uiAreaDrawParams* params)
|
void OnAreaDraw(uiAreaHandler* handler, uiArea* area, uiAreaDrawParams* params)
|
||||||
{
|
{
|
||||||
@ -1856,6 +1862,7 @@ int OnCloseWindow(uiWindow* window, void* blarg)
|
|||||||
while (EmuStatus != 3);
|
while (EmuStatus != 3);
|
||||||
|
|
||||||
CloseAllDialogs();
|
CloseAllDialogs();
|
||||||
|
StopEmuThread();
|
||||||
uiQuit();
|
uiQuit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1893,6 +1900,7 @@ void OnCloseByMenu(uiMenuItem* item, uiWindow* window, void* blarg)
|
|||||||
while (EmuStatus != 3);
|
while (EmuStatus != 3);
|
||||||
|
|
||||||
CloseAllDialogs();
|
CloseAllDialogs();
|
||||||
|
StopEmuThread();
|
||||||
DestroyMainWindow();
|
DestroyMainWindow();
|
||||||
uiQuit();
|
uiQuit();
|
||||||
}
|
}
|
||||||
@ -2691,9 +2699,6 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
uiMain();
|
uiMain();
|
||||||
|
|
||||||
EmuRunning = 0;
|
|
||||||
SDL_WaitThread(EmuThread, NULL);
|
|
||||||
|
|
||||||
if (Joystick) SDL_JoystickClose(Joystick);
|
if (Joystick) SDL_JoystickClose(Joystick);
|
||||||
if (AudioDevice) SDL_CloseAudioDevice(AudioDevice);
|
if (AudioDevice) SDL_CloseAudioDevice(AudioDevice);
|
||||||
if (MicDevice) SDL_CloseAudioDevice(MicDevice);
|
if (MicDevice) SDL_CloseAudioDevice(MicDevice);
|
||||||
|
Reference in New Issue
Block a user