switch: fix exit crash when using SDL_GL_Load/UnloadLibrary (#53)

This commit is contained in:
Cpasjuste 2020-05-19 13:15:44 +02:00 committed by Dave Murphy
parent 69747d1378
commit 911c2b2833
1 changed files with 5 additions and 2 deletions

View File

@ -160,8 +160,11 @@ SWITCH_VideoInit(_THIS)
void void
SWITCH_VideoQuit(_THIS) SWITCH_VideoQuit(_THIS)
{ {
if (_this->gl_config.driver_loaded) { // this should not be needed if user code is right (SDL_GL_LoadLibrary/SDL_GL_UnloadLibrary calls match)
SDL_GL_UnloadLibrary(); // 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 // exit touch