free-audio/interop-tracker

Bitwig 43b6 linux doesn't always call guiDestroy

baconpaul opened this issue · 5 comments

Hi

Run a synth in BWS43b6. I'm using the clap-saw-demo

Open the editor and you get a guiCreate. Close the editor and you get guiDestroy. Fine.

But open the editor and you get a guiCreate. Delete the instrument in the track gutter with the window open and you don't get a guiDestroy. Since there's no guiDestroy I don't unregsiter my timers and you tell me I'm misbehaving. But I think you should have called guiDestroy before you called destroy on the plugin.

Should now be fixed. Though, it did not make it for 4.3b8.

By the way you should also make sure that when the plugin is destroyed you don't leak resources etc... so you could destroy the window there.
I guess this could be done within the clap-helper.

OK, now clap-helper will check if the host forgot to call gui->destroy() and do it and tell the host that it is misbehaving.
free-audio/clap-helpers@5314bd5

Yeah, I'd always make sure everything is cleaned up through destructors/RAII when things get dropped. That way you simply cannot forget to clean things up, and it's thus much less error prone than manually deinitializing/freeing things (guiDestroy should still be called, but if it doesn't then the destructor should still clean up your side of things).

i fixed this by putting "if editor guiDestroy" in my synth destructor, yeah.

will pull new helpers soon