Il 21/05/2019 14:40, Michael Van Canneyt ha scritto:

FreeThenNil should never be necessary. FreeAndNil() should be enough for all circumstances.

In a perfect world maybe you're right. But if you're dealing with LCL, you'll find it sometimes necessary, less your program segfaults, because the freeing of some children is postponed, and when they're set free their parent is already dead. Maybe it's a matter of bad design of some LCL components or even of TApplication, but either you decide that to make your project work you must redesign significant parts of LCL or you give up and sadly take advantage of FreeThenNil().

Giuliano

--
Do not do to others as you would have them do to you.They might have different 
tastes.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to