if not asigned(form) then thisform is free 

解决方案 »

  1.   

    用 if myF = nil then 好像也不行。
      

  2.   

    if not asigned(form) then ...

    if form = nil then ...有什么区别????
      

  3.   

    用if myF = nil then 
      myF := TmyF.create(self);
    第一次运行时没有问题,当myF所指的窗体实体被free后,再运行,就出错了。
      

  4.   

    虽然这时的窗体已经Free了,但myF 并不是nil.
      

  5.   

    if no assigned(form) then和 if form=nil then 是一样的前提是form:=nil如果是modal窗体就可以加上finally
      form.free;
      form:=nil;
    end;
    如果是一般窗体
    在destory里写上 self:=nil;
      

  6.   

    在form1.free后,实际上没必要加form1:=nil.
    应该跟form type or 如何生成 or form变量有关
    myF是在哪声明的?可能跟作用域有关.