diff --git a/imgui.cpp b/imgui.cpp index df2575b15e9e..e2ae4178e1ca 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3835,12 +3835,15 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) { ImGuiContext& g = *GImGui; - - for (int i = 0; i < DC.Layouts.Data.Size; i++) + if (window != NULL) { - ImGuiLayout* layout = (ImGuiLayout*)DC.Layouts.Data[i].val_p; - IM_DELETE(layout); + for (int i = 0; i < window->DC.Layouts.Data.Size; i++) + { + ImGuiLayout* layout = (ImGuiLayout*)window->DC.Layouts.Data[i].val_p; + IM_DELETE(layout); + } } + // While most behaved code would make an effort to not steal active id during window move/drag operations, // we at least need to be resilient to it. Cancelling the move is rather aggressive and users of 'master' branch // may prefer the weird ill-defined half working situation ('docking' did assert), so may need to rework that. diff --git a/premake5.lua b/premake5.lua index 72f448c4b91b..3262c0c86a0f 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,7 +1,8 @@ project "ImGui" kind "StaticLib" language "C++" - staticruntime "off" + cppdialect "C++17" + staticruntime "on" targetdir ("bin/" .. outputdir .. "/%{prj.name}") objdir ("bin-int/" .. outputdir .. "/%{prj.name}") @@ -23,12 +24,10 @@ project "ImGui" filter "system:windows" systemversion "latest" - cppdialect "C++17" filter "system:linux" pic "On" systemversion "latest" - cppdialect "C++17" filter "configurations:Debug" runtime "Debug"