Browse Source

* Fixed memory leak when re-assigning datasource property

git-svn-id: trunk@11312 -
michael 17 years ago
parent
commit
b32a493b7d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/fcl-db/src/sqldb/sqldb.pp

+ 2 - 1
packages/fcl-db/src/sqldb/sqldb.pp

@@ -1508,7 +1508,8 @@ begin
     If Assigned(AValue) then
     If Assigned(AValue) then
       begin
       begin
       AValue.FreeNotification(Self);  
       AValue.FreeNotification(Self);  
-      FMasterLink:=TMasterParamsDataLink.Create(Self);
+      If (FMasterLink=Nil) then
+        FMasterLink:=TMasterParamsDataLink.Create(Self);
       FMasterLink.Datasource:=AValue;
       FMasterLink.Datasource:=AValue;
       end
       end
     else
     else