From b103723df23972d702a9d1f20ef7435a7c382803 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 1 May 2021 19:01:09 +0200 Subject: [PATCH] Make the watchdog much more aggressive For individually hosted plugins this will behave the same. For plugin groups it would have been nice if we could shut down individual plugins, but dangling threads are apparently a real issue. This should be equivalent in all use cases. This also reverts commit bda9a0b75fdf12d9c7410ee95c077e97e5900539. --- src/wine-host/bridges/common.cpp | 12 +++++++++++- src/wine-host/bridges/vst2.cpp | 11 ++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/wine-host/bridges/common.cpp b/src/wine-host/bridges/common.cpp index a7d52aa2..57b614d4 100644 --- a/src/wine-host/bridges/common.cpp +++ b/src/wine-host/bridges/common.cpp @@ -52,6 +52,16 @@ void HostBridge::shutdown_if_dangling() { << std::endl; std::cerr << " This bridge will shut down now." << std::endl; - close_sockets(); + // FIXME: Closing the sockets should work fine, but it still leaves some + // background threads hanging around. For now we'll just + // terminate the entire process instead since we'll probably be + // left in a bad state anyways. The only thing this could + // potentially break would be sharing a plugin group across two + // different DAWs, but you really shouldn't be doing that. :D + // + // Check this commit for another now-unnecessary change we + // reverted here. + // close_sockets(); + TerminateProcess(GetCurrentProcess(), 0); } } diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index 916fe081..2273be39 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -657,13 +657,6 @@ intptr_t VST_CALL_CONV host_callback_proxy(AEffect* effect, intptr_t value, void* data, float option) { - try { - return get_bridge_instance(effect).host_callback(effect, opcode, index, - value, data, option); - } catch (const boost::system::system_error& error) { - std::cerr << "Error while handling callback:" << std::endl; - std::cerr << error.what() << std::endl; - - return -1; - } + return get_bridge_instance(effect).host_callback(effect, opcode, index, + value, data, option); }