# HG changeset patch # User nemo # Date 1511620843 18000 # Node ID 22cc3d82905a4b820e67a39a1738cde74e46ffb4 # Parent 8599a7d4df5415d1ce32ec3e0d2bfda9f65cc994 Should probably have gl context stuff in its own unit separate from store, but, don't close the gl context before anything that might still want to do gl operations diff -r 8599a7d4df54 -r 22cc3d82905a hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Sat Nov 25 09:39:52 2017 -0500 +++ b/hedgewars/hwengine.pas Sat Nov 25 09:40:43 2017 -0500 @@ -548,6 +548,9 @@ {$IFDEF USE_TOUCH_INTERFACE}uTouch.freeModule;{$ENDIF} //stub {$IFDEF ANDROID}GLUnit.freeModule;{$ENDIF} uTextures.freeModule; + SDL_GL_DeleteContext(SDLGLcontext); + SDL_DestroyWindow(SDLwindow); + SDL_Quit() end; uIO.freeModule; diff -r 8599a7d4df54 -r 22cc3d82905a hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sat Nov 25 09:39:52 2017 -0500 +++ b/hedgewars/uStore.pas Sat Nov 25 09:40:43 2017 -0500 @@ -68,8 +68,6 @@ //type TGPUVendor = (gvUnknown, gvNVIDIA, gvATI, gvIntel, gvApple); var - SDLwindow: PSDL_Window; - SDLGLcontext: PSDL_GLContext; squaresize : LongInt; numsquares : LongInt; ProgrTex: PTexture; diff -r 8599a7d4df54 -r 22cc3d82905a hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Sat Nov 25 09:39:52 2017 -0500 +++ b/hedgewars/uVariables.pas Sat Nov 25 09:40:43 2017 -0500 @@ -258,6 +258,9 @@ MaxTextureSize: LongInt; + SDLwindow: PSDL_Window; + SDLGLcontext: PSDL_GLContext; + ///////////////////////////////////// //Buttons {$IFDEF USE_TOUCH_INTERFACE} @@ -2891,6 +2894,9 @@ MissionIcons:= nil; ropeIconTex:= nil; + SDLWindow:= nil; + SDLGLContext:= nil; + for i:= Low(ClansArray) to High(ClansArray) do begin ClansArray[i]:= nil;