diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2020-01-17 21:54:09 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2020-01-17 21:59:00 +0300 |
commit | 5472ae6fdff67ea26d0f9d6f76da02bcd106faf9 (patch) | |
tree | f7f851e4c7383c5681745a57f455f1a88d587d72 /source/blender/blenkernel/intern/collection.c | |
parent | 6744f4d108a8965425233527a3d65cc4a62848f4 (diff) |
Fix memory leak when full-copying a scene after recent changes.
Once again, am not exactly sure why that was working before, and not
anymore - but in any case, doing that kind of update here is not only
useless (since we have to do it at the end of the whole
collections/objects duplication and remapping anyway), it is also rather
dangerous, as collections are currently in rather invalid states at that
point of the code...
Note that in ideal world, `BKE_main_collection_sync()` & co would be
lazy (setting only a flag, then code actually needing this to be valid
again should call some sort of `BKE_main_collection_sync_ensure()`).
Then we would not have to worry about such things (and we'd get nice
performance improvements in some cases, also in main remapping code,
etc.).
Food for some refactoring, some day...
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 68a38c94ff7..c1c3cc62f11 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -1057,6 +1057,11 @@ bool BKE_collection_child_add(Main *bmain, Collection *parent, Collection *child return true; } +bool BKE_collection_child_add_no_sync(Collection *parent, Collection *child) +{ + return collection_child_add(parent, child, 0, true); +} + bool BKE_collection_child_remove(Main *bmain, Collection *parent, Collection *child) { if (!collection_child_remove(parent, child)) { |