T
tl_lyq
Unregistered / Unconfirmed
GUEST, unregistred user!
form1 form2 form3 内存溢出的问题
form1 添加按钮 button1 代码为
procedure TForm1.Button1Click(Sender: TObject);
begin
try form2:=tform2.create(nil);
form2.showmodal;
finally form2.free;
end;
end;
form2 添加button1 代码为
procedure TForm2.Button1Click(Sender: TObject);
begin
if not assigned(form3) then
form3:=tform3.create(form2);
form3.showmodal;
end;
运行程序,点form1的button1,弹出form2,点form2的button1,弹出form3.关闭form3,关闭form2
再点form1的button1,弹出form2,点form2的button,提示内存溢出
为什么?
form1 添加按钮 button1 代码为
procedure TForm1.Button1Click(Sender: TObject);
begin
try form2:=tform2.create(nil);
form2.showmodal;
finally form2.free;
end;
end;
form2 添加button1 代码为
procedure TForm2.Button1Click(Sender: TObject);
begin
if not assigned(form3) then
form3:=tform3.create(form2);
form3.showmodal;
end;
运行程序,点form1的button1,弹出form2,点form2的button1,弹出form3.关闭form3,关闭form2
再点form1的button1,弹出form2,点form2的button,提示内存溢出
为什么?