Fix reference cycles in VST3/CLAP wrappers - #225
Conversation
|
How are you building the plugins? I tried building (edit) Nevermind, I ended up compiling it from within the VM (tried (edit 2) I just realized there's a possibility that I may be compiling it wrong still |
|
Hey just commenting here, as we know Robbert hasn't been maintaining NIH-plug very much, which is why the "maintenance mode" disclaimer thingy in the README has been there, but somehow I never noticed that there's a seemingly actively maintained fork linked in the same disclaimer Check it out https://codeberg.org/BillyDM/nih-plug Sooo check if maybe that version already has your fixes, and if it doesn't it might be worthwhile to open a pull request there |
|
Just quickly comparing the corresponding files and it seems the fork might have your fixes applied already? If it does, it's implemented a bit differently using |
This PR resolves #222, which was caused by the
execute_backgroundandexecute_guicallbacks both receiving a strong clone of their parent wrappers'Arcs, leading to a reference cycle.I've gone for the most obvious fix in this situation - just downgrade the
Arcs before moving them into their respective callbacks, and ignore any tasks posted after the wrappers have been dropped. I've confirmed that this resolves the memory leak (and the subsequent VST3 crash in FL Studio), and I haven't noticed any issues caused by dropping the tasks -- though please correct me if I'm wrong on that.