[Lazarus] Difference between FreeThenNil and FreeAndNil

Alexander Klenin klenin at gmail.com
Wed Apr 27 12:57:36 CEST 2011

On Wed, Apr 27, 2011 at 21:53,  <michael.vancanneyt at wisa.be> wrote:
>> 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.

As you can see from the linked discussion,
currently implemented workaround involves FreeAndNil.
I can imagine a similar bug which might require FreeThenNil instead.

Alexander S. Klenin

More information about the Lazarus mailing list