[Mono-dev] Marshalling C-strings that need to be g_free()d

Jon Shemitz Jon.Shemitz at access-company.com
Tue Jul 7 13:47:44 EDT 2009

Sorry for the newbie question, but my Windows .NET experience doesn't
help me here, nor does MonoDoc or Google. (I'm sure I just don't know
how to ask the right questions, yet, as this must be a FAQ):

If I have a C function like

void caller_owns_string(char** out_string);

How do I tell PInvoke that I 'own' the returned UTF8 string, and that
the marshaller needs to g_free() *out_string after converting it to


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090707/9e226ad7/attachment.html 

More information about the Mono-devel-list mailing list