Closed zshipko closed 11 months ago
Since Ruby doesn't have finalizers and the ruby-sdk ties host functions to a Plugin host environment, I think we could loop over Plugin#functions and call extism_function_free here: https://github.com/extism/ruby-sdk/blob/48454be5f257ed0b22009c3d7ed2f2c1f78a22ce/lib/extism/plugin.rb#L100
Plugin#functions
extism_function_free
^ That approach won't work, we need to call extism_function_free when the HostEnvironment or ExtismFunction is garbage collected since each host function might be used in multiple plugins.
Since Ruby doesn't have finalizers and the ruby-sdk ties host functions to a Plugin host environment,
I think we could loop overPlugin#functions
and callextism_function_free
here: https://github.com/extism/ruby-sdk/blob/48454be5f257ed0b22009c3d7ed2f2c1f78a22ce/lib/extism/plugin.rb#L100^ That approach won't work, we need to call
extism_function_free
when the HostEnvironment or ExtismFunction is garbage collected since each host function might be used in multiple plugins.