Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dalai@blender.org>2020-11-18 04:03:02 +0300
committerDalai Felinto <dalai@blender.org>2020-11-18 04:03:02 +0300
commit15c6390960e6c9f2c92b1045359c2603851f7438 (patch)
tree04f66fa8e43281e43f7960e7ac29ab2d1f555646 /source/blender/depsgraph/intern
parent083cde0b43f606f31021c3381e01654214454b24 (diff)
parent3e325c35f8701eb222a45326c04d54b24e5f23d3 (diff)
Merge remote-tracking branch 'origin/master' into geometry-nodes
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r--source/blender/depsgraph/intern/depsgraph.cc9
-rw-r--r--source/blender/depsgraph/intern/depsgraph.h1
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);