From 9d24a13c4bd5b2d80010e5776233cc49726d3e13 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 31 Oct 2019 18:59:34 +0100 Subject: [PATCH] Fix IO redirection for async execution in wxOSX Don't try running non-bundled applications in wxCocoaLaunch(): this prevents the code handling IO redirection from being used. Check that we have a bundle, just like wxMacaunch(), used until 5b6af7002c944c3328c0cabd1feb79bd125c033f, used to do. Closes #18552. See https://github.com/wxWidgets/wxWidgets/pull/1561 --- src/osx/cocoa/utils_base.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osx/cocoa/utils_base.mm b/src/osx/cocoa/utils_base.mm index 071d3f3dd3..5a428fcf7d 100644 --- a/src/osx/cocoa/utils_base.mm +++ b/src/osx/cocoa/utils_base.mm @@ -217,6 +217,14 @@ bool wxCocoaLaunch(const char* const* argv, pid_t &pid) return false ; } + // Don't try running non-bundled applications here, we don't support output + // redirection, which is important for them, unlike for the bundled apps, + // so let the generic Unix code handle them. + if ( [NSBundle bundleWithURL:url] == nil ) + { + return false; + } + // Loop through command line arguments to the bundle, // turn them into CFURLs and then put them in cfaFiles // For use to launch services call