--- In [email protected], Rob Kennedy <[EMAIL PROTECTED]> wrote:
>
> mikcaau wrote:
> >> When I have posted that the following lines:
> >>
> >>   Obj := Nil;
Obj = nill
You cannot get to it anymore, its address is lost
Mick

> >>   Obj.Free();
> >
> > This will cause an exception
> 
> No it won't. What exception do you think it will raise?
> 
> >   try
> >     Obj.Free;
> >     Obj := nil;
> >   except
> >     on E:Exception do;
> >   end;
> > 
> > will not!
> > Once you set Obj := nil you cannot reach it 
> 
> But you can still call non-virtual methods on that variable, and
Free in 
> particular won't do anything if it detects that it has been called on a 
> null reference.
> 
> -- 
> Rob
>



Reply via email to