vst-rs
vst-rs copied to clipboard
Preventing memory leak when plugin is unloaded
We are using Box::into_raw in VSTPluginMain but when a plugin is unloaded in a host, how will the memory get freed?
How are hosts usually freeing the memory when unloading a vst dll?
Are hosts usually calling delete aeffect; on the pointer returned by VSTPluginMain (assuming that they were written in C++)? Or are they not even trying to free the memory?
It might not happen often that plugins are unloaded/reloaded but we should still strive to avoid memory leaks..
We may need to manage a static pool of plugin instances from within the lib and clean up the memory when the host notifies us before destruction. (Which I think they are supposed to do)
How does the host notify the plugin?
@Boscop via Shutdown opcode. It seems like it's already implemented, so this issue can be closed.