rust-diplomat / diplomat

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code
https://rust-diplomat.github.io/book/
Other
532 stars 51 forks source link

Register finalizer for Kotlin Opaque #708

Closed emarteca closed 1 month ago

emarteca commented 1 month ago

Register the finalizer for opaques so the Rust memory cleanup is only called if Rust has passed a Box<Opaque> back to Kotlin (and so Kotlin owns the handler and is responsible for telling Rust that the memory should be cleaned up). This is done with Cleaners already.