royalapplications / beyondnet

A toolset that makes it possible to call .NET code from other programming languages, including C, Swift and Kotlin.
https://royalapps.com
MIT License
111 stars 5 forks source link

Memory leak for reference types returned from delegates #4

Closed lemonmojo closed 1 year ago

lemonmojo commented 1 year ago

Currently we leak memory for objects (strings, managed objects) returned from delegates. This can be observed in AnimalTests and TransformerTests.

One solution would be to assume on the managed side that we have to release any reference types that are given to us. Then we can just allocate on the native side and don't have to worry about releasing.

lemonmojo commented 1 year ago

Fixed by freeing reference types that are returned by delegates.