On Thu, January 12, 2017 2:08 am, Michael Schnell wrote:
> 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.
>

What if you are porting code to a non jvm... if you copy and paste
something and it has no free, you're screwed.

i.e. say you have some JVM algorithms that now need to be used in win32 or
bsd using the regular fpc compilation.... can't port them without
inspecting the code carefully for missing free's


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

Reply via email to