[Lazarus] Difference between FreeThenNil and FreeAndNil

Marc Weustink marc.weustink at cuperus.nl
Wed Apr 27 11:26:03 CEST 2011


J├╝rgen Hestermann wrote:
>
>
> michael.vancanneyt at wisa.be schrieb:
>> I don't think you should provide for this. This is encouraging people to
>> write bad code. They should get an error, and correct their code.
>
> Agree.
> I also don't understand why it is needed to manually free and
> set nil an object pointer if a destructor for the object exists
> which should do all this. This is like writing another destructor
> and makes object oriented programming (even more) useless.

On 15-1-2005 I had a heavy discussion with Mattias about this. IMO it 
was needed for a design flaw and he couldn't convince me why it was 
needed. I won't start that discussion again.

Marc




More information about the Lazarus mailing list