窗体内存释放的问题
主窗口调用的时候
procedure TMainFrm.N31Click(Sender: TObject);
begin
if ClientFrm = nil then
ClientFrm:=TClientInputFrm.Create(self);
ClientFrm.ShowModal;
end;
释放的时候
procedure TClientFrm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=caFree;
clientFrm:=nil;
end;
为什么在我测试使用内存的时候,窗口关闭只释放 反而不如不是动态生成的。
类别 开始内存 打开窗口最大内存 关闭窗口之后的内存
使用动态 6796K 7180K 7164K
不用动态 7256K 7332K 7268K