[Lazarus] Difference between FreeThenNil and FreeAndNil

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Wed Apr 27 12:53:17 CEST 2011



On Wed, 27 Apr 2011, Alexander Klenin wrote:

> On Wed, Apr 27, 2011 at 21:20,  <michael.vancanneyt at wisa.be> wrote:
>> I would like to see a non-trivial example of this.
>>
>> Even if you can produce one (which I doubt), it doesn't change the fact that
>> it is wrong coding.
>
> http://bugs.freepascal.org/view.php?id=16035

But what does this have to do with the problem you mention in FreeAndNil ?

It's rebuilding a component tree, while part of the tree is still being
destroyed. That this will go wrong seems logical to me, but irrelevant to
FreeAndNil.

Michael.




More information about the Lazarus mailing list