matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Missing memory managment calls (destroy) on FFI objec?t

Open BillCarsonFr opened this issue 2 years ago • 2 comments

Looks like we have to manually release some FFIObjects

Image

BillCarsonFr avatar Feb 17 '23 11:02 BillCarsonFr

Do you find what you're looking for in the Kotlin Lifetimes Chapter of the UniFFI book?

All interfaces exposed via Kotlin expose a public API for freeing the Kotlin wrapper object in lieu of reliable finalizers. This is done by making the "base class" for all such generated objects implement the Disposable and AutoCloseable interfaces.

As such, these wrappers all implement a close() method, which must be explicitly called to ensure the associated Rust resources are reclaimed.

Hywan avatar Oct 22 '24 08:10 Hywan

You can also ask how @ganfra or @bmarty are doing?

Hywan avatar Oct 22 '24 08:10 Hywan