Hi!
Functions may return a const gchar** with (transfer container), in which case the caller has to free the surrounding "container" with g_free to not create a memory leak.
This patch makes gir-to-d follow that behavior.
I include the glib.c.functions module now for g_free - using Str.freeString would also have worked, as that just calls g_free, but that would have required a typecast, and we are freeing a memory segment here and not a string, so I found just using g_free to be more appropriate.
Cheers,
Matthias
Hi! Functions may return a
const gchar**
with(transfer container)
, in which case the caller has to free the surrounding "container" withg_free
to not create a memory leak. This patch makes gir-to-d follow that behavior. I include theglib.c.functions
module now forg_free
- usingStr.freeString
would also have worked, as that just callsg_free
, but that would have required a typecast, and we are freeing a memory segment here and not a string, so I found just usingg_free
to be more appropriate. Cheers, Matthias