Fixed a PVS Studio static analyzer warning.

This commit is contained in:
omar 2019-05-10 22:58:24 +02:00
parent 835a8b2c9b
commit b668726a38

View File

@ -11524,8 +11524,9 @@ void ImGui::DockContextProcessDock(ImGuiContext* ctx, ImGuiDockRequest* req)
// Central node property needs to be moved to a leaf node, pick the last focused one. // Central node property needs to be moved to a leaf node, pick the last focused one.
// FIXME-DOCKING: If we had to transfer other flags here, what would the policy be? // FIXME-DOCKING: If we had to transfer other flags here, what would the policy be?
ImGuiDockNode* last_focused_node = DockContextFindNodeByID(ctx, payload_node->LastFocusedNodeID); ImGuiDockNode* last_focused_node = DockContextFindNodeByID(ctx, payload_node->LastFocusedNodeID);
IM_ASSERT(last_focused_node != NULL);
ImGuiDockNode* last_focused_root_node = DockNodeGetRootNode(last_focused_node); ImGuiDockNode* last_focused_root_node = DockNodeGetRootNode(last_focused_node);
IM_ASSERT(last_focused_node != NULL && last_focused_root_node == DockNodeGetRootNode(payload_node)); IM_ASSERT(last_focused_root_node == DockNodeGetRootNode(payload_node));
last_focused_node->LocalFlags |= ImGuiDockNodeFlags_CentralNode; last_focused_node->LocalFlags |= ImGuiDockNodeFlags_CentralNode;
node->LocalFlags &= ~ImGuiDockNodeFlags_CentralNode; node->LocalFlags &= ~ImGuiDockNodeFlags_CentralNode;
last_focused_root_node->CentralNode = last_focused_node; last_focused_root_node->CentralNode = last_focused_node;