From 44bfa24cc30118ea24dc6e185c1e066f39bda338 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 2 Oct 2018 11:09:53 +0200 Subject: [PATCH] Docking: Fixed crash using DockBuilderSplitNode(). (#2109) --- imgui.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index cea99d5b2d49..583004c05d7f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10092,7 +10092,6 @@ void ImGui::DockContextProcessDock(ImGuiContext* ctx, ImGuiDockRequest* req) TabBarAddTab(target_node->TabBar, target_node->Windows[n], ImGuiTabItemFlags_None); } - const ImGuiID payload_node_id = payload_node ? payload_node->ID : payload_window->DockId; if (payload_node != NULL) { // Transfer full payload node (with 1+ child windows or child nodes) @@ -10116,18 +10115,20 @@ void ImGui::DockContextProcessDock(ImGuiContext* ctx, ImGuiDockRequest* req) } else { + const ImGuiID payload_dock_id = payload_node->ID; DockNodeMoveWindows(target_node, payload_node); - DockSettingsMoveDockReferencesInInactiveWindow(payload_node_id, target_node->ID); + DockSettingsMoveDockReferencesInInactiveWindow(payload_dock_id, target_node->ID); } DockContextRemoveNode(ctx, payload_node, true); } else if (payload_window) { // Transfer single window + const ImGuiID payload_dock_id = payload_window->DockId; target_node->VisibleWindow = payload_window; DockNodeAddWindow(target_node, payload_window, true); - if (payload_node_id != 0) - DockSettingsMoveDockReferencesInInactiveWindow(payload_node_id, target_node->ID); + if (payload_dock_id != 0) + DockSettingsMoveDockReferencesInInactiveWindow(payload_dock_id, target_node->ID); } }