Browse Source

* take care of destructor being called if constructor failed

git-svn-id: trunk@22601 -
michael 13 years ago
parent
commit
fdf66d1be9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      packages/fcl-db/src/base/fields.inc

+ 3 - 2
packages/fcl-db/src/base/fields.inc

@@ -3142,8 +3142,9 @@ end;
 Destructor TFields.Destroy;
 
 begin
-  Clear;
-  FFieldList.Free;
+  if Assigned(FFieldList) then
+    Clear;
+  FreeAndNil(FFieldList);
   inherited Destroy;
 end;