Initialize COM early as we call SHGetKnownFolderPath as part of crash reporter setup

This commit is contained in:
dpjudas 2024-06-16 02:31:34 +02:00
commit c66b809d4e

View file

@ -229,9 +229,6 @@ int DoMain (HINSTANCE hInstance)
WinWidth = cRect.right;
WinHeight = cRect.bottom;
if (SUCCEEDED(CoInitialize(nullptr)))
atexit ([](){ CoUninitialize(); }); // beware of calling convention.
int ret = GameMain ();
if (mainwindow.CheckForRestart())
@ -296,6 +293,9 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE nothing, LPWSTR cmdline, int
InitCommonControls();
if (SUCCEEDED(CoInitialize(nullptr)))
atexit([]() { CoUninitialize(); }); // beware of calling convention.
#if defined(_DEBUG) && defined(_MSC_VER)
// Uncomment this line to make the Visual C++ CRT check the heap before
// every allocation and deallocation. This will be slow, but it can be a