From 00acaa32996e05809b8f86371309f4553e91887b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 6 Apr 2024 12:14:53 +0200 Subject: [PATCH] Build the RAIntegration menu on the right thread --- Core/RetroAchievements.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/RetroAchievements.cpp b/Core/RetroAchievements.cpp index 7185adb529aa..d97d9427ba45 100644 --- a/Core/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -531,8 +531,10 @@ static void load_integration_callback(int result, const char *error_message, rc_ rc_client_raintegration_set_write_memory_function(g_rcClient, &raintegration_write_memory_handler); rc_client_raintegration_set_get_game_name_function(g_rcClient, &raintegration_get_game_name_handler); - HWND hWnd = (HWND)userdata; - rc_client_raintegration_rebuild_submenu(g_rcClient, GetMenu(hWnd)); + System_RunCallbackInWndProc([](void *vhWnd, void *userdata) { + HWND hWnd = reinterpret_cast(vhWnd); + rc_client_raintegration_rebuild_submenu(g_rcClient, GetMenu(hWnd)); + }, nullptr); break; } case RC_MISSING_VALUE: