我有两个单元unitA和unitB。 类TFoo在unitB中声明。
在unitA的终结部分中调用B.Free总是安全的吗?
这取决于unitA和unitB在dpr文件中的顺序吗?
当执行unitA终结时,我能确定unitB存在吗?
unit unitB;
interface
type
TFoo = class
// code...
end;
// code....
end;
unit unitA;
// code..
implementation
uses
unitB;
var
A: TStringList;
B: UnitB.TFoo;
initialization
A:= TStringList.Create;
B:= UnitB.TFoo.Create;
finalization
A.Free;
B.Free; // Is it safe to call?
end.