diff --git a/Windows/main.cpp b/Windows/main.cpp index b46c3e3c01..4d00b25236 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -133,7 +133,12 @@ static double g_lastKeepAwake = 0.0; static constexpr double ACTIVITY_IDLE_TIMEOUT = 2.0 * 3600.0; void System_LaunchUrl(LaunchUrlType urlType, const char *url) { - ShellExecute(NULL, L"open", ConvertUTF8ToWString(url).c_str(), NULL, NULL, SW_SHOWNORMAL); + std::string u(url); + std::thread t = std::thread([u]() { + ShellExecute(NULL, L"open", ConvertUTF8ToWString(u).c_str(), NULL, NULL, SW_SHOWNORMAL); + }); + // Detach is bad (given exit behavior), but in this case all the thread does is a ShellExecute to avoid freezing the caller while it runs, so it's safe. + t.detach(); } void System_Vibrate(int length_ms) {