Inochi2D/inochi2d-c

Caveats regarding GC

Closed this issue · 1 comments

IIRC dlang has a GC, so it is better to copy the external resources into D's own heap, because we won't be so sure if someone accidentally free'd the underlying memory.

All memory managment of Inochi2D resources is done with functions from the library, you're not supposed to call free on Inochi2D resources, but use the dedicated Destroy functions provided.

All things returned by inochi2d-c are set as gc roots so they will never be collected until destroyed.