hedgewars/uStore.pas
changeset 2284 bd091b6b128d
parent 2258 3dd028604cfd
child 2285 6746bda385e8
--- a/hedgewars/uStore.pas	Tue Jul 28 12:50:47 2009 +0000
+++ b/hedgewars/uStore.pas	Tue Jul 28 16:29:39 2009 +0000
@@ -990,6 +990,7 @@
     Step: integer = 0;
 	squaresize : LongInt;
 	numsquares : integer;
+
 procedure AddProgress;
 var r: TSDL_Rect;
     texsurf: PSDL_Surface;
@@ -1004,6 +1005,8 @@
    numsquares:= ProgrTex^.h div squaresize;
    end;
 
+TryDo(ProgrTex <> nil, 'ProgrTex = nil!', true);
+
 glClear(GL_COLOR_BUFFER_BIT);
 glEnable(GL_TEXTURE_2D);
 if Step < numsquares then r.x:= 0
@@ -1021,7 +1024,8 @@
 procedure FinishProgress;
 begin
 WriteLnToConsole('Freeing progress surface... ');
-FreeTexture(ProgrTex)
+FreeTexture(ProgrTex);
+ProgrTex:= nil
 end;
 
 procedure flipSurface(Surface: PSDL_Surface; Vertical: Boolean);