Browse Source

* Fix bug #33399, RemovePage does not free page

git-svn-id: trunk@38468 -
michael 7 years ago
parent
commit
ad409edb30
1 changed files with 8 additions and 1 deletions
  1. 8 1
      packages/fcl-report/src/fpreport.pp

+ 8 - 1
packages/fcl-report/src/fpreport.pp

@@ -7813,6 +7813,9 @@ end;
 
 procedure TFPCustomReport.Clear;
 
+Var
+  P : TFPReportCustomPage;
+
 begin
   // Variables
   FRTCurPageIdx := -1;
@@ -7825,7 +7828,11 @@ begin
   if Assigned(FPages) then
     begin
     While PageCount>0 do
-      RemovePage(Pages[FPages.Count-1]);
+      begin
+      P:=Pages[PageCount-1];
+      RemovePage(P);
+      FreeAndNil(P);
+      end;
     FPages.Clear;
     end;
   ClearReferenceList;