On 11.01.2017 11:25, Sven Barth wrote:

We're talking about JVM here where garbage collections *must* be used. So FPC does as well for that target.

This of course is true. But if the class code is in fpc, fpc paradigms should be adhered, as well. and here the fpc code *can* e.g. explicitly allocate stuff that needs to be freed later, or e.g. can open a connection to whatever that needs to be closed later, and so (if not using ref counted objects) with such classes destroy() needs to be called (via the free() chain).

Regarding this, IMHO it would be good practice to always provide destroy and free, and if it's empty it does not harm to call it.

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

Reply via email to