> Looking for places where I could find borland's advice, I could not find 
> any. However I did find a lot of advices where they just suggest 
> freeandnil(form1).
>
> to complete your explaination, do you have any url to where this 
> suggestion could be found on the borland site?
>
> It's not that I do not aggree, but I myself also used freeandnil(form1) 
> untill now.

I'd like to just make 2 observations:
1.) It is legal to do: Form.Release; Form := nil; (Or you can write a 
ReleaseAndNil routine if you like.) (i.e. the point being that when using 
release there's nothing stopping you from nilling the object reference as 
soon as you've issued the Release.)
2.) You can actually use Form.Free; Form := nil; (or FreeAndNil(Form) *but* 
*only* *if* you're sure the form in question does not have pending event 
messages etc, and if you're sure you're *not calling it from within an event 
handler* of the form (or a routine called directly or indirectly via an 
event handler of the form.)  Thus basically what Borland says.  The latter 
is usually the key thing to watch out for I think (ie trying to call 
free/free a form in response to an event - this should always be handled via 
Release.)  If you want to be safe I suppose one could use Release 
exclusively.

Walter




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to