Skip to content

Commit

Permalink
Docking: Fix DockBuilderRemoveNode() may cause read access violation. (
Browse files Browse the repository at this point in the history
  • Loading branch information
hsimyu committed Apr 29, 2020
1 parent 7ddc1ad commit 0f62b71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14183,6 +14183,12 @@ void ImGui::DockBuilderRemoveNode(ImGuiID node_id)
return;
DockBuilderRemoveNodeDockedWindows(node_id, true);
DockBuilderRemoveNodeChildNodes(node_id);

// Check is node_id still available (#3111)
node = DockContextFindNodeByID(ctx, node_id);
if (node == NULL)
return;

if (node->IsCentralNode() && node->ParentNode)
node->ParentNode->LocalFlags |= ImGuiDockNodeFlags_CentralNode;
DockContextRemoveNode(ctx, node, true);
Expand Down

0 comments on commit 0f62b71

Please sign in to comment.