VST3PluginTestHost not calling destructor?

SDK for VST 3 audio plug-in and host development.
Post Reply
dancrn
Posts: 2
Joined: Mon Oct 03, 2016 4:29 pm

VST3PluginTestHost not calling destructor?

Post by dancrn »

Hi all,

I'm having a problem with the VST3PluginTestHost not calling my plugin's destructor.

My plugin spawns some threads to do IO work occasionally (to keep the processing thread IO free). This thread is joined during my destructor, but this is never called - this leaves the thread running on what eventually becomes garbage memory, which then causes a crash.

I can reproduce this behaviour 100% reliably when I remove my plugin from the VST rack in VST3PluginTestHost. Quitting the test host does not cause the crash.

Oddly, I do not see the destructor in the plugin lifecycle diagram on the (frustratingly sparse..!) VST3 documentation pages. Does this mean the destructor is not guaranteed to be called? When I run my plugin in Cubase, it's generally fine - although Windows test machines occasionally crash on quitting cubase, or on session close.

It is entirely possible that the code base I'm working with isn't doing something right, but I've been chasing this bug for a few days, and I can't find anything.

Any help would be much appreciated.

Thanks,

Arne Scheffler
Posts: 383
Joined: Mon Jun 20, 2016 7:53 am

Re: VST3PluginTestHost not calling destructor?

Post by Arne Scheffler »

Don't use the constructor and destructor. Use the initialize(..) and terminate(..) methods to allocate/deallocate system resources.

dancrn
Posts: 2
Joined: Mon Oct 03, 2016 4:29 pm

Re: VST3PluginTestHost not calling destructor?

Post by dancrn »

So, I'm using a.. *heavily* modified WDL-OL framework, which doesn't seem to pass through terminate calls..

For the record, I think adopting the COM model was a terrible idea -_-

Thanks for getting back to me so quick!

Post Reply