diff --git a/src/progress.c b/src/progress.c index baab9c41..90c87e21 100644 --- a/src/progress.c +++ b/src/progress.c @@ -320,7 +320,7 @@ static void progress_write(SDL_RWops *file) { } free(buf); - SDL_RWclose(file); + SDL_RWclose(vfile); } #ifdef PROGRESS_UNLOCK_ALL diff --git a/src/taiseigl.c b/src/taiseigl.c index b7d68ff8..901931db 100644 --- a/src/taiseigl.c +++ b/src/taiseigl.c @@ -118,6 +118,12 @@ void load_gl_library(void) { #endif } +void unload_gl_library(void) { +#ifndef LINK_TO_LIBGL + SDL_GL_UnloadLibrary(); +#endif +} + void load_gl_functions(void) { #ifndef LINK_TO_LIBGL #define GLDEF(glname,tsname,typename) tsname = (typename)get_proc_address(#glname); diff --git a/src/taiseigl.h b/src/taiseigl.h index aafe2a53..61d87404 100644 --- a/src/taiseigl.h +++ b/src/taiseigl.h @@ -102,6 +102,7 @@ extern struct glext_s glext; void load_gl_library(void); void load_gl_functions(void); void check_gl_extensions(void); +void unload_gl_library(void); #define gluPerspective tsgluPerspective void gluPerspective(GLdouble fovY, GLdouble aspect, GLdouble zNear, GLdouble zFar); diff --git a/src/video.c b/src/video.c index 0f4a7f33..2f02f503 100644 --- a/src/video.c +++ b/src/video.c @@ -232,5 +232,6 @@ void video_init(void) { void video_shutdown(void) { SDL_DestroyWindow(video.window); SDL_GL_DeleteContext(video.glcontext); + unload_gl_library(); free(video.modes); }