fix leaking of hand-drawn maps
authorsheepluva
Tue, 29 Mar 2011 16:24:55 +0200
changeset 5066 d2684b6f02ce
parent 5065 0c2c509ccc7b
child 5067 57101536cf86
fix leaking of hand-drawn maps
hedgewars/hwengine.pas
hedgewars/uLandPainted.pas
--- a/hedgewars/hwengine.pas	Mon Mar 28 20:13:03 2011 -0400
+++ b/hedgewars/hwengine.pas	Tue Mar 29 16:24:55 2011 +0200
@@ -390,6 +390,7 @@
 
     uIO.freeModule;             //stub
     uLand.freeModule;
+    uLandPainted.freeModule;
 
     uCommandHandlers.freeModule;
     uCommands.freeModule;
--- a/hedgewars/uLandPainted.pas	Mon Mar 28 20:13:03 2011 -0400
+++ b/hedgewars/uLandPainted.pas	Tue Mar 29 16:24:55 2011 +0200
@@ -24,6 +24,7 @@
 
 procedure Draw;
 procedure initModule;
+procedure freeModule;
 
 implementation
 uses uLandGraphics, uConsts, uUtils, SDLh, uCommands, uDebug;
@@ -171,4 +172,16 @@
     RegisterVariable('draw', vtCommand, @chDraw, false);
 end;
 
+procedure freeModule;
+var pe, pp: PPointEntry;
+begin
+    pe:= pointsListHead;
+    while(pe <> nil) do
+        begin
+        pp:= pe;
+        pe:= pe^.next;
+        dispose(pp);
+        end;
+end;
+
 end.