Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Preventing memory leak when plugin is unloaded #41

Open
Boscop opened this issue Apr 22, 2018 · 3 comments
Open

Preventing memory leak when plugin is unloaded #41

Boscop opened this issue Apr 22, 2018 · 3 comments
Labels
bug important A high priority issue

Comments

@Boscop
Copy link
Member

Boscop commented Apr 22, 2018

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..

@zyvitski zyvitski added bug important A high priority issue labels Apr 25, 2018
@zyvitski
Copy link
Member

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)

@Boscop
Copy link
Member Author

Boscop commented Apr 26, 2018

How does the host notify the plugin?

@inikulin
Copy link
Contributor

inikulin commented Jan 2, 2020

@Boscop via Shutdown opcode. It seems like it's already implemented, so this issue can be closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug important A high priority issue
Projects
None yet
Development

No branches or pull requests

3 participants