From ee971f610e557321b8b963f4a461026eb1bcaea6 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 21 Feb 2023 15:01:01 +0100 Subject: [PATCH] Fix missing detached flag in Process::Handle moves This is why C++'s move semantics are footguns. The result of this was that grouped plugins would no longer be detached when they were moved (in this case, into the group connect handler closure). Which in turn caused those plugins to block until the plugin host process terminated, which thus ended up blocking the host indefinitely. --- CHANGELOG.md | 4 ++++ src/common/process.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22bdfc2c..9d202adc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed +- Fixed a regression from yabridge 4.0.0 where plugin groups would not exit + correctly. When removing a plugin instance that was part of a plugin group, it + would block until the group host process had exited, causing the host to + stall. - Configuring the Meson build now works correctly on Wine 8.0 final. Meson's version comparison function considers `8.0` to be a lower version than `8.0rc2`. diff --git a/src/common/process.cpp b/src/common/process.cpp index dbaf21ff..5c84ed0c 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -194,13 +194,15 @@ Process::Handle::~Handle() { } } -Process::Handle::Handle(Handle&& o) noexcept : pid_(o.pid_) { +Process::Handle::Handle(Handle&& o) noexcept + : detached_(o.detached_), pid_(o.pid_) { o.detached_ = true; } Process::Handle& Process::Handle::operator=(Handle&& o) noexcept { o.detached_ = true; + detached_ = o.detached_; pid_ = o.pid_; return *this;