diff options
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 9 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.h | 1 |
2 files changed, 5 insertions, 5 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; diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h index e03846f81e2..14c91834739 100644 --- a/source/blender/depsgraph/intern/depsgraph.h +++ b/source/blender/depsgraph/intern/depsgraph.h @@ -73,7 +73,6 @@ struct Depsgraph { IDNode *find_id_node(const ID *id) const; IDNode *add_id_node(ID *id, ID *id_cow_hint = nullptr); void clear_id_nodes(); - void clear_id_nodes_conditional(const std::function<bool(ID_Type id_type)> &filter); /* Add new relationship between two nodes. */ Relation *add_new_relation(Node *from, Node *to, const char *description, int flags = 0); |