Skip to content

Commit

Permalink
GUI2/Tree View Node: used std::make_shared when possible
Browse files Browse the repository at this point in the history
Child nodes were still managed with unique_ptrs in 1.14, so we couldn't use make_unique
there. Child nodes are now managed with shared_ptrs here on master.
  • Loading branch information
Vultraz committed Oct 19, 2019
1 parent 36b4b24 commit c177400
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/gui/widgets/tree_view_node.hpp
Expand Up @@ -70,8 +70,7 @@ class tree_view_node : public widget
const std::map<std::string /* widget id */, string_map>& data,
const int index = -1)
{
ptr_t new_node(new tree_view_node(id, this, get_tree_view(), data));
return add_child_impl(std::move(new_node), index);
return add_child_impl(std::make_shared<tree_view_node>(id, this, get_tree_view(), data), index);
}

/**
Expand Down

0 comments on commit c177400

Please sign in to comment.