[Lazarus] Help debugging

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Jan 11 20:15:29 CET 2012


Kjow schrieb:

> if assigned(body) Then
>  body.free;

That's crap :-(

Free checks for Nil objects, the test can be omitted.
But when the variable stays non-nil, the next run will try again to free 
the object, and kaboum :-(

Better use:
   FreeAndNil(body);

DoDi





More information about the Lazarus mailing list