再给主窗体的onclose事件写mainform.release;
                         mainform:=nil;时并没有release方法;
而其他的窗体都可以用。谢谢了