shogun icon indicating copy to clipboard operation
shogun copied to clipboard

C# SGMatrix and SGVectorList typemaps leak memory

Open ghost opened this issue 6 years ago • 3 comments

In the out typemaps for both SGMatrix and std::vector<SGVector>, memory is allocated using malloc, but it's not freed.

https://github.com/shogun-toolbox/shogun/blob/c948611b1e075b731d92c109d22abe79279b0a77/src/interfaces/csharp/swig_typemaps.i#L37-L53

https://github.com/shogun-toolbox/shogun/blob/c948611b1e075b731d92c109d22abe79279b0a77/src/interfaces/csharp/swig_typemaps.i#L231-L256

These allocated buffers are passed to C# code as IntPtr, and can't be deallocated from there.

ghost avatar Aug 27 '19 08:08 ghost

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 26 '20 15:02 stale[bot]

I have a simple solution in mind. I will attend to this issue this weekend.

ghost avatar Feb 26 '20 17:02 ghost

No rush! I just added this bot to clean up the repo

gf712 avatar Feb 26 '20 17:02 gf712