From fe5e45028da5da4b662835d0dbef177e6263e310 Mon Sep 17 00:00:00 2001 From: BeWorld <36823759+BeWorld2018@users.noreply.github.com> Date: Sun, 19 Mar 2023 10:55:44 +0100 Subject: [PATCH] SDL2 - Fix memory leek when exit game add SDL_GL_DeleteContext and SDL_DestroyWindow --- Quake/gl_vidsdl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index 21035046..d236d0e7 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -1394,12 +1394,14 @@ void VID_Shutdown (void) if (vid_initialized) { VID_Gamma_Shutdown (); //johnfitz - +#if defined(USE_SDL2) + SDL_GL_DeleteContext(gl_context); + gl_context = NULL; + SDL_DestroyWindow(draw_context); +#endif SDL_QuitSubSystem(SDL_INIT_VIDEO); draw_context = NULL; -#if defined(USE_SDL2) - gl_context = NULL; -#endif + PL_VID_Shutdown(); } }