Windows: Fix file and folder dialog freeze (#369)

Initializing the COM library immediately seems to be more robust than doing it on demand
This commit is contained in:
Exzap 2022-10-14 12:49:41 +02:00 committed by GitHub
parent d251ce07e0
commit a19ed46b2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 47 deletions

View file

@ -323,10 +323,10 @@ void HandlePostUpdate()
fs::remove(filename, ec);
}
#else
while( fs::exists(filename) )
while (fs::exists(filename))
{
std::error_code ec;
fs::remove(filename, ec);
fs::remove(filename, ec);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}
#endif
@ -338,8 +338,10 @@ void ToolShaderCacheMerger();
#if BOOST_OS_WINDOWS
// entrypoint for release builds
int wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nShowCmd)
int wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nShowCmd)
{
if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE)))
cemuLog_log(LogType::Force, "CoInitializeEx() failed");
SDL_SetMainReady();
if (!LaunchSettings::HandleCommandline(lpCmdLine))
return 0;
@ -350,6 +352,8 @@ int wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ L
// entrypoint for debug builds with console
int main(int argc, char* argv[])
{
if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED | COINIT_DISABLE_OLE1DDE)))
cemuLog_log(LogType::Force, "CoInitializeEx() failed");
SDL_SetMainReady();
if (!LaunchSettings::HandleCommandline(argc, argv))
return 0;