diff --git a/es-core/src/utils/PlatformUtil.cpp b/es-core/src/utils/PlatformUtil.cpp index 4f904da8f..a702c464c 100644 --- a/es-core/src/utils/PlatformUtil.cpp +++ b/es-core/src/utils/PlatformUtil.cpp @@ -147,7 +147,7 @@ namespace Utils } int launchGameWindows(const std::wstring& cmd_utf16, - std::wstring& startDirectory, + const std::wstring& startDirectory, bool runInBackground, bool hideWindow) { @@ -165,7 +165,8 @@ namespace Utils bool processReturnValue = true; DWORD errorCode = 0; - wchar_t* startDir {startDirectory == L"" ? nullptr : &startDirectory[0]}; + std::wstring startDirectoryTemp {startDirectory}; + wchar_t* startDir {startDirectory == L"" ? nullptr : &startDirectoryTemp[0]}; // clang-format off processReturnValue = CreateProcessW( diff --git a/es-core/src/utils/PlatformUtil.h b/es-core/src/utils/PlatformUtil.h index 6b5a12023..1dd319f5c 100644 --- a/es-core/src/utils/PlatformUtil.h +++ b/es-core/src/utils/PlatformUtil.h @@ -37,7 +37,7 @@ namespace Utils const std::string& startDirectory, bool runInBackground); int launchGameWindows(const std::wstring& cmd_utf16, - std::wstring& startDirectory, + const std::wstring& startDirectory, bool runInBackground, bool hideWindow);