diff options
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 870a6d3fce8..17eeba55a27 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -133,9 +133,10 @@ IDNode *Depsgraph::add_id_node(ID *id, ID *id_cow_hint) return id_node; } -void Depsgraph::clear_id_nodes_conditional(const std::function<bool(ID_Type id_type)> &filter) +template<typename FilterFunc> +static void clear_id_nodes_conditional(Depsgraph::IDDepsNodes *id_nodes, const FilterFunc &filter) { - for (IDNode *id_node : id_nodes) { + for (IDNode *id_node : *id_nodes) { if (id_node->id_cow == nullptr) { /* This means builder "stole" ownership of the copy-on-written * datablock for her own dirty needs. */ @@ -156,8 +157,8 @@ void Depsgraph::clear_id_nodes() /* Free memory used by ID nodes. */ /* Stupid workaround to ensure we free IDs in a proper order. */ - clear_id_nodes_conditional([](ID_Type id_type) { return id_type == ID_SCE; }); - clear_id_nodes_conditional([](ID_Type id_type) { return id_type != ID_PA; }); + clear_id_nodes_conditional(&id_nodes, [](ID_Type id_type) { return id_type == ID_SCE; }); + clear_id_nodes_conditional(&id_nodes, [](ID_Type id_type) { return id_type != ID_PA; }); for (IDNode *id_node : id_nodes) { delete id_node; |