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
While using ImGui with metal, I noticed that it was crashing during the shutdown. That's because, inside ImGui_ImplMetal_Shutdown, line 160, the code io.BackendRendererUserData = nullptr; is making the function ImGui_ImplMetal_GetBackendData to return nullptr, and thus, all subsequent functions (to destroy objects and fonts) are going to crash.
THERE IS already a function to clean the io.BackendRendererUserData and it's called ImGui_ImplMetal_DestroyBackendData
I can make a PR if needed, but this is going to crash for whoever uses it.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
voidImGui_ImplMetal_Shutdown()
{
ImGui_ImplMetal_Data* bd = ImGui_ImplMetal_GetBackendData();
IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
ImGui_ImplMetal_ShutdownPlatformInterface();
ImGuiIO& io = ImGui::GetIO();
io.BackendRendererName = nullptr;
// io.BackendRendererUserData = nullptr; // <-- this is going to crash whatever function calls ImGui_ImplMetal_GetBackendData later.
io.BackendFlags &= ~(ImGuiBackendFlags_RendererHasVtxOffset | ImGuiBackendFlags_RendererHasViewports);
ImGui_ImplMetal_DestroyDeviceObjects();
ImGui_ImplMetal_DestroyBackendData();
}
The text was updated successfully, but these errors were encountered:
Version/Branch of Dear ImGui:
docking
Back-ends:
imgui_impl_metal.mm
Compiler, OS:
Xcode
Full config/build information:
No response
Details:
Crash inside ImGui_ImplMetal_DestroyFontsTexture:
While using ImGui with metal, I noticed that it was crashing during the shutdown. That's because, inside ImGui_ImplMetal_Shutdown, line 160, the code
io.BackendRendererUserData = nullptr;
is making the functionImGui_ImplMetal_GetBackendData
to return nullptr, and thus, all subsequent functions (to destroy objects and fonts) are going to crash.THERE IS already a function to clean the
io.BackendRendererUserData
and it's calledImGui_ImplMetal_DestroyBackendData
I can make a PR if needed, but this is going to crash for whoever uses it.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: