Skip to content

Commit

Permalink
Docking: Fixed crash using DockBuilderSplitNode(). (#2109)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Oct 2, 2018
1 parent 2cff3f6 commit 44bfa24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 44bfa24

Please sign in to comment.