From 23f0b751b57b2dd9f6e912cec92364ff59b864b2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 9 Sep 2021 22:24:07 +0300 Subject: fix for a crappy ::GetCurrentThread call that breaks all Wait* functions --- plugins/Console/src/Console.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins/Console/src') diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index a874f8c4cd..d6c3d5dc6e 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -891,10 +891,9 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam //////////////////////////////////////////////////////////////////////////////// - -void __cdecl ConsoleThread(void*) +static void __cdecl ConsoleThread(void*) { - MThreadHandle threadLock(g_plugin.hConsoleThread); + MThreadLock threadLock(g_plugin.hConsoleThread); CoInitialize(nullptr); HWND hwnd = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CONSOLE), nullptr, ConsoleDlgProc); @@ -1210,7 +1209,7 @@ void InitConsole() LoadSettings(); - mir_forkthread(ConsoleThread); + g_plugin.hConsoleThread = mir_forkthread(ConsoleThread); HookEvent(ME_SYSTEM_PRESHUTDOWN, PreshutdownConsole); HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded); -- cgit v1.2.3