IDManagement: Add assert against no-main IDs passed to `BKE_id_delete`.
This high-level function can only deal with IDs in main, trying to use it to delete/free a no-main ID does nothing.
This commit is contained in:
parent
5df916f23f
commit
33400ffcc9
|
@ -350,6 +350,9 @@ static size_t id_delete(Main *bmain, const bool do_tagged_deletion)
|
|||
|
||||
void BKE_id_delete(Main *bmain, void *idv)
|
||||
{
|
||||
BLI_assert_msg((((ID *)idv)->tag & LIB_TAG_NO_MAIN) == 0,
|
||||
"Cannot be used with IDs outside of Main");
|
||||
|
||||
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
|
||||
((ID *)idv)->tag |= LIB_TAG_DOIT;
|
||||
|
||||
|
|
Loading…
Reference in New Issue