Skip to content

Commit

Permalink
switch: fix exit crash when using SDL_GL_Load/UnloadLibrary (devkitPr…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste authored and WinterMute committed Jan 20, 2024
1 parent 84fd9f5 commit 165f8a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/video/switch/SDL_switchvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ SWITCH_VideoInit(_THIS)
void
SWITCH_VideoQuit(_THIS)
{
if (_this->gl_config.driver_loaded) {
SDL_GL_UnloadLibrary();
// this should not be needed if user code is right (SDL_GL_LoadLibrary/SDL_GL_UnloadLibrary calls match)
// this (user) error doesn't have the same effect on switch thought, as the driver needs to be unloaded (crash)
if(_this->gl_config.driver_loaded > 0) {
SWITCH_GLES_UnloadLibrary(_this);
_this->gl_config.driver_loaded = 0;
}

// exit touch
Expand Down

0 comments on commit 165f8a4

Please sign in to comment.