From 09a60a98b7f62502ef6c26243edb70fbc838d056 Mon Sep 17 00:00:00 2001 From: Quentin <837334+xiaoxiao921@users.noreply.github.com> Date: Sat, 3 Aug 2024 18:14:42 +0200 Subject: [PATCH] fix(RID join): crash on join #3474 (#3511) --- src/views/network/view_network.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/network/view_network.cpp b/src/views/network/view_network.cpp index e0d64494..66f1df7e 100644 --- a/src/views/network/view_network.cpp +++ b/src/views/network/view_network.cpp @@ -19,19 +19,23 @@ namespace big const char* name; }; + static uint64_t rid = 0; + void render_join_game() { ImGui::SeparatorText("JOIN_GAME"_T.data()); ImGui::BeginGroup(); - static uint64_t rid = 0; ImGui::SetNextItemWidth(200); bool rid_submitted = ImGui::InputScalar("##inputrid", ImGuiDataType_U64, &rid, nullptr, nullptr, nullptr, ImGuiInputTextFlags_EnterReturnsTrue); ImGui::SameLine(); if (components::button("JOIN_BY_RID"_T) || rid_submitted) { - session::join_by_rockstar_id(rid); + const auto rid_lambda = rid; + g_fiber_pool->queue_job([rid_lambda]() { + session::join_by_rockstar_id(rid_lambda); + }); } ImGui::SetNextItemWidth(200);