[Mono-list] InteropServices: DllNotFoundException...?

Marcus marcus@mylinuxisp.com
Sun, 23 May 2004 20:10:16 -0500

I ran a short test, and it appears the Mono runtime still does not free 
strings returned from P/Invoke methods. Do you know if there is a bug report 
about this? I did a query and could not find one.

I was not sure about Mono's behavior, so I wrote a short test case, which I 
can file with the bug report if there isn't one already.

On Saturday 22 May 2004 11:01 pm, Jonathan Pryor wrote:

> However, there is another issue present: strings.  Your DllImport
> declarations specify that System.String is the return type.  This will
> cause the runtime to attempt to free the strings returned by those
> functions.  IIRC, Mono will use g_free() to free that memory.  If those
> strings weren't allocated by g_malloc(), this could lead to heap
> corruption.