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
authornemo
Sat, 25 Nov 2017 09:40:43 -0500
changeset 12849 22cc3d82905a
parent 12848 8599a7d4df54
child 12850 b63ec501490b
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
hedgewars/hwengine.pas
hedgewars/uStore.pas
hedgewars/uVariables.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;
--- 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;
--- 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;