On 6 July 2010 18:42, Andrew Brunner <andrew.t.brun...@gmail.com> wrote:
>>> Nope. If Obj2 failed to create you will have a problem with Obj2.Free.
>>
>> Nope. That's why it is free and not destroy.
>
> Double Nope.  You cannot access methods of a nil object.  Nil.Free
> will in-it-and-of-it cause a read access violation.

Wrong again Andrew. Calling .Free is safe (even if the instance
variable is nil) because internally it checks if the instance exists
before continuing with calling .Destroy on that instance.  Delphi 101.
 ;-)


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to