From 649916f0983e4c59201672e6e28dcc7ae1f655b2 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sun, 7 Mar 2021 14:24:52 +0100 Subject: BLI: make it harder to forget to destruct a value Instead of returning a raw pointer, `LinearAllocator.construct(...)` now returns a `destruct_ptr`, which is similar to `unique_ptr`, but does not deallocate the memory and only calls the destructor instead. --- source/blender/modifiers/intern/MOD_nodes.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 4d1823b8951..50c07578173 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -1045,8 +1045,8 @@ static GeometrySet compute_geometry(const DerivedNodeTree &tree, * modifier. */ const OutputSocketRef *first_input_socket = group_input_sockets[0]; if (first_input_socket->bsocket()->type == SOCK_GEOMETRY) { - GeometrySet *geometry_set_in = allocator.construct( - std::move(input_geometry_set)); + GeometrySet *geometry_set_in = + allocator.construct(std::move(input_geometry_set)).release(); group_inputs.add_new({root_context, first_input_socket}, geometry_set_in); remaining_input_sockets = remaining_input_sockets.drop_front(1); } -- cgit v1.2.3