GUI2/Tree View Node: used std::make_shared when possible

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.
This commit is contained in:
Charles Dang 2018-07-14 06:38:08 +11:00
parent 36b4b24a8f
commit c1774005a9

View file

@ -70,8 +70,7 @@ public:
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);
}
/**