Explorar o código

* fixed memory leak in DrawTest, when running more than one test

git-svn-id: trunk@16004 -
nickysn %!s(int64=15) %!d(string=hai) anos
pai
achega
263fc7b6ff
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      packages/graph/tests/drawtest.pas

+ 10 - 0
packages/graph/tests/drawtest.pas

@@ -49,6 +49,14 @@ begin
   end;
 end;
 
+procedure FreePixArray;
+var
+  Y: Integer;
+begin
+  for Y := 0 to YRes - 1 do
+    FreeMem(PixArray[Y], XRes * SizeOf(TPixelColor));
+end;
+
 procedure TestFinalResult;
 var
   X, Y: Integer;
@@ -162,6 +170,8 @@ begin
 
   TestFinalResult;
 
+  FreePixArray;
+
   CloseGraph;
   Writeln('Ok');
 end;