From c58126d244e4fec6c8ad4bfee856a41d2dd80a3d Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Mon, 6 Jan 2025 02:40:38 -0500 Subject: [PATCH] Fix assert when disconnecting --- .../ThirdParty/NetImgui/Private/NetImgui_Client.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Plugins/Cog/Source/ThirdParty/NetImgui/Private/NetImgui_Client.cpp b/Plugins/Cog/Source/ThirdParty/NetImgui/Private/NetImgui_Client.cpp index 11866dd..6cdde43 100644 --- a/Plugins/Cog/Source/ThirdParty/NetImgui/Private/NetImgui_Client.cpp +++ b/Plugins/Cog/Source/ThirdParty/NetImgui/Private/NetImgui_Client.cpp @@ -633,7 +633,16 @@ void ClientInfo::ContextRestore() if (IsContextOverriden() && ImGui::GetCurrentContext() == mpContext) { #ifdef IMGUI_HAS_VIEWPORT - ImGui::UpdatePlatformWindows(); // Prevents issue with mismatched frame tracking, when restoring enabled viewport feature + +//************************************************************************************************* +// COG: Disabling the call ImGui::UpdatePlatformWindows() otherwise it gets called twice when +// disconnecting causing this assert in ImGui::UpdatePlatformWindows(): +// +// IM_ASSERT(g.FrameCountPlatformEnded < g.FrameCount); +//************************************************************************************************* + + //ImGui::UpdatePlatformWindows(); // Prevents issue with mismatched frame tracking, when restoring enabled viewport feature + #endif if( mFontCreationFunction && ImGui::GetIO().Fonts && ImGui::GetIO().Fonts->Fonts.size() > 0) {