Explorar o código

* take care of destructor being called if constructor failed

git-svn-id: trunk@22601 -
michael %!s(int64=13) %!d(string=hai) anos
pai
achega
fdf66d1be9
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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;