怎么样在关闭form的时候把form内的私有对象内存释放? 怎么样在close一个form的时候把申明在private内的一个OBJ:TOBJECT对象所占的内存释放?我在close事件中写:inherited; Action := caFree;我在TFORM1.Destroy方法中:OBJ.FREE;但是我注意了一下:Destroy方法并没有执行?怎么回事? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的OBJ创建了吗?OBJ:=OBJ.CREATE; function PMCreateOutCusForm(AOutBound_Cus:TOutBound_Cus;AOwner : TWinControl) : TOutCusForm;begin Result := TOutCusForm.Create(Application); Result.BorderStyle := bsNone; Result.Parent := AOwner; Result.Align := alClient; Result.Show;end;constructor TOutCusForm.Create(AOwner : TComponent);begin inherited; OutBound_Cus := TOutBound_Cus.Create;end;destructor TOutCusForm.Destroy;begin OutBound_Cus.Free; inherited;end;procedure TOutCusForm.CancelOutBtnClick(Sender: TObject);begin Close;end;procedure TOutCusForm.FormClose(Sender: TObject; var Action: TCloseAction);begin inherited; Action := caFree;end;每次调用PMCreateOutCusForm方法创建form,点击CancelButton按钮close掉Form... caFree The form is closed and all allocated memory for the form is freed.应该没有问题 对象不是new出来的,不用释放。 祝大家元旦快乐! ACCESS数据库的更新疑问! 如何取出动态创建的edit的text(看了很多的类似的东西,还是想不出来) 关于FastReport的复杂报表,请感兴趣的朋友帮忙顶,高手帮忙回答一下。谢谢拉 ip地址转换为一个整数 关于文本文件读取的问题? 使用GRID控件作为输入界面,如何判断用户已修改了数据? 过年了,最后一个问题,进来给分!(马上结帖) 我干,AGENTINA完蛋了,我的彩票也完蛋,天啊。。。 请问各位大虾可否告之如何在webbrower里显示当前的链接地址吗? 如何判断任何后缀名的文件是关闭状态 ? DBGrid问题
OBJ:=OBJ.CREATE;
begin
Result := TOutCusForm.Create(Application);
Result.BorderStyle := bsNone;
Result.Parent := AOwner;
Result.Align := alClient;
Result.Show;
end;constructor TOutCusForm.Create(AOwner : TComponent);
begin
inherited;
OutBound_Cus := TOutBound_Cus.Create;end;destructor TOutCusForm.Destroy;
begin
OutBound_Cus.Free;
inherited;
end;procedure TOutCusForm.CancelOutBtnClick(Sender: TObject);
begin
Close;
end;procedure TOutCusForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;每次调用PMCreateOutCusForm方法创建form,点击CancelButton按钮close掉Form...
应该没有问题