Explicitly initialize COM library in main and opengl threads, hopefully fixing filedialog issues.

This commit is contained in:
ts-korhonen
2021-06-17 19:15:35 +03:00
parent a389e2988a
commit ed86f69c85
2 changed files with 11 additions and 0 deletions

View File

@@ -417,6 +417,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
SetCurrentProcessExplicitAppUserModelID(AppID);
/* Initialize the COM library for the main thread. */
CoInitializeEx(NULL, COINIT_MULTITHREADED);
/* Check if Windows supports UTF-8 */
if (GetACP() == CP_UTF8)
acp_utf8 = 1;
@@ -465,6 +468,9 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
/* Handle our GUI. */
i = ui_init(nCmdShow);
/* Uninitialize COM before exit. */
CoUninitialize();
free(argbuf);
free(argv);
return(i);