Hello,

The problem probably caused by the application trying
to free object(s) that already been freed, either by
you (in the main form's OnClose event) or by the owner
of the object. Just remember that if you create a
control with owner other than nil then the owner will
free the control on its destructor block.

So you need to remove codes that doing this (if you
created them with Self (i.e. the mainform) as the
owner):
> then tested to see if they are nil or not in
> the mainform's OnClose event, and if they 
> are not nil, their individual 
> FreeAndNil(IniFile), DataModule.Destroy, and
> InterfaceF.Close methods are called.

Btw, you should not call DataModule.Destroy. The safer
methode is DataModule.Free. Also I personally prefer
InterfaceF.Free instead of InterfaceF.Close, unless
you do cleaning up in OnClose event or you want to use
OnCloseQuery event.

>In it's ExitActionExecute, if I use MainF1.Close
I think it's safer to use Self.Close here. Since there
is probability that in the future you will use another
instance on TMainF1 which is not MainF1.


Regards,

Luthfi


      
____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, 
and more!
http://tv.yahoo.com/collections/3658 
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to