hedgewars/uLandObjects.pas
changeset 3057 e6e4c109ceb8
parent 3053 55a7e3a896ef
child 3083 8da8f2515221
--- 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.