From 34e3f1a1bf496e52cc48cd6d020e77b4535fc9c8 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 20 Jun 2020 13:43:54 +0200 Subject: [PATCH] Don't set WINEPREFIX for the current process `native_environment` allows modification of the current process's environment, so we had to use the plain `environment` class instead. --- CHANGELOG.md | 3 +++ src/plugin/plugin-bridge.cpp | 2 +- src/plugin/utils.cpp | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 340738ca..2ead32c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ Versioning](https://semver.org/spec/v2.0.0.html). the same name from being used simultaneously in multiple Wine prefixes. - Fixed manual Wine prefix overides through the `WINEPREFIX` environment variable not being reflected in the output shwon in startup. +- Fixed the Wine prefix being overwritten for all subsequent plugins opened + within the same process. This prevented the use of multiple Wine prefixes + within hosts that do not sandbox their plugins, such as Ardour. ## [1.2.0] - 2020-05-29 diff --git a/src/plugin/plugin-bridge.cpp b/src/plugin/plugin-bridge.cpp index 4f03bcb7..93b75eca 100644 --- a/src/plugin/plugin-bridge.cpp +++ b/src/plugin/plugin-bridge.cpp @@ -597,7 +597,7 @@ void PluginBridge::log_init_message() { // If the Wine prefix is manually overridden, then this should be made // clear. This follows the behaviour of `set_wineprefix()`. - bp::native_environment env = boost::this_process::environment(); + bp::environment env = boost::this_process::environment(); if (!env["WINEPREFIX"].empty()) { init_msg << env["WINEPREFIX"].to_string() << " "; } else { diff --git a/src/plugin/utils.cpp b/src/plugin/utils.cpp index 350a7544..e1d50a03 100644 --- a/src/plugin/utils.cpp +++ b/src/plugin/utils.cpp @@ -242,7 +242,7 @@ std::string get_wine_version() { // used to run Wine, so will will respect this as well std::string wine_command = "wine"; - bp::native_environment env = boost::this_process::environment(); + bp::environment env = boost::this_process::environment(); if (!env["WINELOADER"].empty()) { wine_command = env.get("WINELOADER"); } @@ -271,7 +271,7 @@ std::string get_wine_version() { } bp::environment set_wineprefix() { - bp::native_environment env = boost::this_process::environment(); + bp::environment env = boost::this_process::environment(); // Allow the wine prefix to be overridden manually if (!env["WINEPREFIX"].empty()) {