Investigate Managed Struct
seanhandley opened this issue · 0 comments
seanhandley commented
Pointers are GC'd automatically in FFI but structs may not be.
See https://www.rubydoc.info/github/ffi/ffi/FFI/ManagedStruct and https://www.varvet.com/blog/advanced-topics-in-ruby-ffi/
Also check the FFI wiki.