close时,窗体并没有被释放,只是隐藏了.
对于动态创建的窗体,释放时用如下方法:
    if Assigned(Yourform) then yourform.Free;

解决方案 »

  1.   

    在Form的CloseQuery中,Action := caFree;Form1 := nil;
      

  2.   

    try
      ....
      yourForm.showModal;
    finally
      yourForm.free;
      yourForm:=nil;
    end;
      

  3.   

    在Form的onClose中  Action  :=  caFree;
    onDestroy中         Form1  :=  nil;
      

  4.   

    释放
    FreeAndNil(Form1);动态创建窗体的时候,最好指定窗体的Owner,这样万一忘了释放内存,在窗体的Owner释放的时候会连该窗体所占一起释放掉
      

  5.   


      在Form的OnClose中,Action  :=  caFree;Form1  :=  nil;