memory leak. change string value through dll by reference

 
c#:

        [DllExport]
        static void test_change_string_value_by_reference([In, Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder my_str)
        {
            my_str.Clear();
            my_str.Append("here is the string from c#.net ");
        }

mql5:


#import "dll_test.dll"
void  test_change_string_value_by_reference(string & str);
#import
void OnStart()

  {

   string my_str="";

   test_change_string_value_by_reference(my_str);

   Print("new_value_of_str: ",my_str);

  }

Files:
leak.png  4 kb
Reason: