Free land object SDL surfaces.
--- a/hedgewars/hwengine.pas Tue Mar 23 16:53:45 2010 +0000
+++ b/hedgewars/hwengine.pas Tue Mar 23 19:06:43 2010 +0000
@@ -154,7 +154,8 @@
if isSoundEnabled then ReleaseSound();
StoreRelease();
FreeGearsList();
- FreeVisualGears;
+ FreeVisualGears();
+ FreeLandObjects();
FreeLand();
ControllerClose();
SendKB();
--- a/hedgewars/uLandObjects.pas Tue Mar 23 16:53:45 2010 +0000
+++ b/hedgewars/uLandObjects.pas Tue Mar 23 19:06:43 2010 +0000
@@ -23,6 +23,7 @@
uses SDLh;
procedure AddObjects();
+procedure FreeLandObjects();
procedure LoadThemeConfig;
procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface);
procedure AddOnLandObjects(Surface: PSDL_Surface);
@@ -526,4 +527,15 @@
ReadThemeInfo(ThemeObjects, SprayObjects)
end;
+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);
+end;
+
end.