diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ba86ce..bcc8ed53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,8 +35,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). - Fixed an issue where in certain situations Wine processes were left running after the host got forcefully terminated before it got a chance to tell the plugin to shut down. This could happen when using Kontakt in Bitwig, as Bitwig - sets a limit on the amount of time a plugin may take to shut down when closing - Bitwig. + sets a limit on the amount of time a plugin may take to close when closing + Bitwig, and Kontakt can take a while to shut down. - Fixed a potential crash or freeze when removing a lot of plugins from a plugin group at exactly the same time. diff --git a/src/wine-host/bridges/group.cpp b/src/wine-host/bridges/group.cpp index 579988c1..bbdf1f61 100644 --- a/src/wine-host/bridges/group.cpp +++ b/src/wine-host/bridges/group.cpp @@ -154,7 +154,10 @@ void GroupBridge::handle_plugin_dispatch(size_t plugin_id) { if (active_plugins.size() == 0) { logger.log( "All plugins have exited, shutting down the group process"); - main_context.stop(); + + // main_context.stop(); + // FIXME: See the comment in `individual-host.cpp` + TerminateProcess(GetCurrentProcess(), 0); } }); } diff --git a/src/wine-host/individual-host.cpp b/src/wine-host/individual-host.cpp index aeff5f5a..bbfa0cdc 100644 --- a/src/wine-host/individual-host.cpp +++ b/src/wine-host/individual-host.cpp @@ -114,9 +114,17 @@ main(int argc, char* argv[]) { Win32Thread worker_thread([&]() { bridge->run(); - // When the sockets get closed, this application should - // terminate gracefully - main_context.stop(); + // // When the sockets get closed, this application should + // // terminate gracefully + // main_context.stop(); + // FIXME: So some of the background threads spawned by the plugin may + // get stuck if the host got terminated abruptly. After an entire + // day of debugging I still have no idea whether this is a bug in + // yabridge, Wine, or those plugins, but just killing off this + // process and all of its threads 'fixes' the issue. + // + // https://github.com/robbert-vdh/yabridge/issues/69 + TerminateProcess(GetCurrentProcess(), 0); }); std::cout << "Finished initializing '" << plugin_location << "'"