TFrame 对象的 destroy 重写解决方案

TFrame对象的 destroy 重写TContractMain class(TFrame).......publicconstructor Create(AOwner: TComp

TFrame 对象的 destroy 重写
TContractMain = class(TFrame)  
.......
  public
  constructor Create(AOwner: TComponent);Override;

  destructor Destroy; override;
  end


constructor TContractMain.Create(AOwner: TComponent);
begin
  Inherited create(AOwner);

  DModule.GetCompanyInfor(cmBox_Company);
end;

destructor TContractMain.Destroy;
begin
  showmessage('1');


  inherited Destroy;


end;

在使用该 Frame 时 为什么 Destroy 没有执行

[解决办法]
你都没有释放Form3,当然不会执行啦!

Application.CreateForm(TForm3, Form3); 
try
Form3.ShowModal; 
finally
FreeAndNil(Form3);
end;