Use MAXTHEMEOBJECTS instead of Count which appears to be 0 at this point.
authornemo
Wed, 24 Mar 2010 11:01:21 +0000
changeset 3057 e6e4c109ceb8
parent 3056 141c26d2717d
child 3058 2ebc20485344
Use MAXTHEMEOBJECTS instead of Count which appears to be 0 at this point.
hedgewars/uLandObjects.pas
--- a/hedgewars/uLandObjects.pas	Tue Mar 23 23:08:57 2010 +0000
+++ b/hedgewars/uLandObjects.pas	Wed Mar 24 11:01:21 2010 +0000
@@ -530,12 +530,12 @@
 procedure FreeLandObjects();
 var i: Longword;
 begin
-for i:= 0 to Pred(ThemeObjects.Count) do
-    with ThemeObjects.objs[i] do
-        if Surf <> nil then SDL_FreeSurface(Surf);
-for i:= 0 to Pred(SprayObjects.Count) do
-    with SprayObjects.objs[i] do
-        if Surf <> nil then SDL_FreeSurface(Surf);
+for i:= 0 to Pred(MAXTHEMEOBJECTS) do
+    if ThemeObjects.objs[i].Surf <> nil then
+        SDL_FreeSurface(ThemeObjects.objs[i].Surf);
+for i:= 0 to Pred(MAXTHEMEOBJECTS) do
+    if SprayObjects.objs[i].Surf <> nil then
+        SDL_FreeSurface(SprayObjects.objs[i].Surf);
 end;
 
 end.