On 20/05/2019 11:01 pm, Giuliano Colla wrote:
> In some rare case when dealing with complex objects you might need 
> FreeThenNil() in place of FreeAndNil().

As far as I'm concerned, that is such a broken concept! The developer
already has the burden to free any memory that he/she allocates. With
what you are saying, it is now expected from the developer to look at
all source code, flip and coin to decide how complex it is (that will
vary between developers) and then decide which Free(Then|And)Nil()
function to call!?  That should really be left up to the compiler and
should be of no concern to the developer.

Or there is a much simpler answer - the code the developer is working on
is severely broken and needs some refactoring and decoupling of
dependencies.

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to