-
Notifications
You must be signed in to change notification settings - Fork 533
Closed
Labels
Description
I noticed this in one of our wrapped functions:
protected Effect(string name)
{
var arg0 = Marshal.StringToHGlobalAnsi(name);
__Instance = Marshal.AllocHGlobal(88);
Internal.ctor_0(__Instance, arg0);
}
Here you use Marshal.StringToHGlobalAnsi
to marshal the string to C++, but you don't free the string. From the docs it says that you should be calling Marshal.FreeHGlobal(arg0);
to free that memory.
I suspect this is a memory leak in CppSharp.