You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assert when shutting down and recreating backend #2769
I implement a graphic library that it can change APIs in runtime.
But it always assert when recreating imgui.
I modified it below, but it's not a good method.
Has any good idea to resolve this assert?
My recreating method :
ImGui_ImplXX_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui_ImplWin32_Init(hWnd);
ImGui_ImplXX_Init(g_instance, 0, g_device);
I don't run ImGui::DestroyContext(); / ImGui::CreateContext();
And the PlatformWindowCreated of main-viewport is initialized in ImGui::CreateContext(); only.
So it would be assert the problem.
Pushed a fix for this issue.
Ideally we may want this field to be set/cleared by the platform back-end. We'll probably refactor this when working on #2471.
Activity
ocornut commentedon Aug 29, 2019
Please:
TL;DR; we need more context please.
metarutaiga commentedon Aug 29, 2019
My recreating method :
ImGui_ImplXX_Shutdown();
ImGui_ImplWin32_Shutdown();
ImGui_ImplWin32_Init(hWnd);
ImGui_ImplXX_Init(g_instance, 0, g_device);
I don't run ImGui::DestroyContext(); / ImGui::CreateContext();
And the PlatformWindowCreated of main-viewport is initialized in ImGui::CreateContext(); only.
So it would be assert the problem.
[-]Assert when recreating imgui [/-][+]Assert when shutting down and recreating backend[/+]kudaba commentedon Aug 30, 2019
I think you're hitting the crash that I fixed here: #2698, at least I think you're using the vulkan backend, you should include that in reports.
Viewport: fix to allow multiple shutdown / calls to DestroyPlatformWi…
ocornut commentedon Sep 17, 2019
Pushed a fix for this issue.
Ideally we may want this field to be set/cleared by the platform back-end. We'll probably refactor this when working on #2471.
IO: added ImGuiPlatformIO::ClearPlatformHandlers(), ClearRendererHand…
IO: amend ImGuiPlatformIO::ClearPlatformHandlers(), ClearRendererHand…
IO: added ImGuiPlatformIO::ClearPlatformHandlers(), ClearRendererHand…
IO: restore default platform handlers on ClearPlatformHandlers. (#9537,