Browse Source

* Fixed mem-leak

git-svn-id: trunk@16824 -
joost 14 years ago
parent
commit
9191eb35a9
1 changed files with 8 additions and 0 deletions
  1. 8 0
      packages/fcl-web/src/base/webpage.pp

+ 8 - 0
packages/fcl-web/src/base/webpage.pp

@@ -84,6 +84,7 @@ type
     procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
     property ContentProducerList: TFPList read GetContentProducerList;
   public
+    destructor Destroy; override;
     function ContentProducerCount: integer;
 
     function ProduceContent : string;
@@ -261,6 +262,13 @@ begin
       Proc(ContentProducers[i]);
 end;
 
+destructor TWebPage.Destroy;
+begin
+  if assigned(FContentProducers) then
+    FreeAndNil(FContentProducers);
+  inherited Destroy;
+end;
+
 function TWebPage.ContentProducerCount: integer;
 begin
   if assigned(FContentProducers) then