Dalija Prasnikar Profile picture
"Eppur si muove" Software Developer & Photographer. Embarcadero MVP. Author https://t.co/LAKXaAj4Fm. Crashing other people's software and writing my own since '85
Jun 29, 2022 12 tweets 3 min read
FreeAndNil() and Assigned() debate is coming up soon blogs.embarcadero.com/freeandnil-del…

This may seem like simple topic, but in order to discuss when and whether one should use FreeAndNil() and Assigned(), we need to understand related, more complex processes happening in our code. Image In Delphi object references are generally not automatically initialized to zero (nil).
Only class fields, object instance fields and global variables are automatically initialized.
Local object references and record fields are not initialized.