free memory not clears the memory block

前端 未结 3 826
迷失自我
迷失自我 2021-01-16 06:19

I am using DllImport to call method in c wrapper library from my own .net class. This method in c dll creates a string variable and returns the pointer of the string.

<
3条回答
  •  独厮守ぢ
    2021-01-16 07:15

    Although memory is allocated by the DLL in the same heap as your application, it MAY be using a different memory manager, depending on the library it was linked with. You need to either make sure you're using the same exact library, or add code to release the memory that the DLL allocates, in the DLL code itself.

提交回复
热议问题