From b04e1da0d9757c5dd008700be3fc198925aff6a1 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 8 Nov 2020 21:49:52 +0100 Subject: [PATCH] Terminate the Wine host after the sockets close The Wine host application would not close properly if the VST host would suddenly crash or terminate without closing all plugins. --- CHANGELOG.md | 8 ++++++++ src/wine-host/individual-host.cpp | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08a4e68e..c730808d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Fixed a regression where `yabridge-host.exe` would not exit on its own after + the host crashes or gets terminated without being able to properly close all + plugins. + ## [2.0.0] - 2020-11-08 ### Added diff --git a/src/wine-host/individual-host.cpp b/src/wine-host/individual-host.cpp index 1fc812e7..96e1f911 100644 --- a/src/wine-host/individual-host.cpp +++ b/src/wine-host/individual-host.cpp @@ -83,7 +83,13 @@ int __cdecl main(int argc, char* argv[]) { // We'll listen for `dispatcher()` calls on a different thread, but the // actual events will still be executed within the IO context - Win32Thread dispatch_handler([&]() { bridge->handle_dispatch(); }); + Win32Thread dispatch_handler([&]() { + bridge->handle_dispatch(); + + // When the sockets get closed, this application should terminate + // gracefully + main_context.stop(); + }); // Handle Win32 messages and X11 events on a timer, just like in // `GroupBridge::async_handle_events()``