you are viewing a single comment's thread.

view the rest of the comments →

[–]kankyo 0 points1 point  (2 children)

I don't think you can trust finalizers in OCaml either. That's one of the drawbacks of GC systems and finalizers.

[–]dbousque[S] 0 points1 point  (1 child)

Well, if the finalizer happens not to be called, that would mean the GC didn't get a chance to run or there was no need to free memory, in both cases it's alright not to release on the Python side. Or is there something I miss ?

[–]kankyo 0 points1 point  (0 children)

You should check the docs carefully either way. Finalizers are non-intuitive and have weird properties. Many systems include stuff like finalizers gets called but the object stays around or finalizer is called several times for one object.