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 <dfelinto@gmail.com>2017-11-07 19:06:55 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-11-07 19:08:34 +0300
commit1b18e158025a488e1ba2446ad93c2eb563c11611 (patch)
tree9fa432d1bd7e622cb0d7cd4a9160bdff7d30c554 /source/blender/makesrna/intern/rna_depsgraph.c
parentfc789803cabc9dfd47319a7f0297456c8f60153c (diff)
Sanitize use of BLI_iterator
We now initialize iter.valid as true as part of the main iterator (and manually when using via Python). And we don't even bother setting iter->current to NULL if it's invalid. Let's stick to using iter->valid only.
Diffstat (limited to 'source/blender/makesrna/intern/rna_depsgraph.c')
-rw-r--r--source/blender/makesrna/intern/rna_depsgraph.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c
index f5b4d9cde0f..04c8352833e 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -154,6 +154,7 @@ static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, Pointe
data->graph = (Depsgraph *)ptr->data;
data->flag = DEG_OBJECT_ITER_FLAG_SET;
+ ((BLI_Iterator *)iter->internal.custom)->valid = true;
DEG_objects_iterator_begin(iter->internal.custom, data);
iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
}
@@ -190,6 +191,7 @@ static void rna_Depsgraph_duplis_begin(CollectionPropertyIterator *iter, Pointer
data->graph = (Depsgraph *)ptr->data;
data->flag = DEG_OBJECT_ITER_FLAG_ALL;
+ ((BLI_Iterator *)iter->internal.custom)->valid = true;
DEG_objects_iterator_begin(iter->internal.custom, data);
iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
}