diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-30 15:37:54 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-30 16:08:48 +0300 |
commit | 79bbbf7e200258b63c0e4e71e9a8508b11a95946 (patch) | |
tree | d67253ec4beb3c5d1181a2d93fc91a3dedb83889 /source/blender | |
parent | ba17d53e599ddf780ba54cc2bb64554e1f1e8690 (diff) |
Fix memory leak when single_obdata_users() fails to copy datablock
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 895777fc63a..b2e976f17a9 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1846,8 +1846,11 @@ static void single_obdata_users(Main *bmain, Scene *scene, ViewLayer *view_layer ob->data = ID_NEW_SET(ob->data, BKE_lightprobe_copy(bmain, ob->data)); break; default: - if (G.debug & G_DEBUG) - printf("ERROR %s: can't copy %s\n", __func__, id->name); + printf("ERROR %s: can't copy %s\n", __func__, id->name); + BLI_assert(!"This should never happen."); + + /* We need to end the FOREACH_OBJECT_FLAG iterator to prevent memory leak. */ + BKE_scene_objects_iterator_end(&iter_macro); return; } |