Fix memory leak when single_obdata_users() fails to copy datablock
This commit is contained in:
parent
ba17d53e59
commit
79bbbf7e20
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue