Cleanup BKE_id_free_ex().

Add 'missing' bpy code from BKE_libblock_free_ex(), now both functions
do exactly the same thing, only the later is less flexible (fewer
'exotic' behaviors supported, like handling IDs outside of bmain etc.).

Next step: nuke usages of BKE_libblock_free functions, makes no sense to
have twice the same code around!
This commit is contained in:
2019-01-14 15:38:05 +01:00
parent 93867cfafc
commit 2f39ca3843

View File

@@ -846,7 +846,12 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i
}
#ifdef WITH_PYTHON
# ifdef WITH_PYTHON_SAFETY
BPY_id_release(id);
# endif
if (id->py_instance) {
BPY_DECREF_RNA_INVALIDATE(id->py_instance);
}
#endif
if ((flag & LIB_ID_FREE_NO_USER_REFCOUNT) == 0) {
@@ -856,7 +861,7 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i
BKE_libblock_free_datablock(id, flag);
/* avoid notifying on removed data */
if (bmain) {
if ((flag & LIB_ID_FREE_NO_MAIN) == 0) {
BKE_main_lock(bmain);
}
@@ -877,7 +882,7 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i
BKE_libblock_free_data(id, (flag & LIB_ID_FREE_NO_USER_REFCOUNT) == 0);
if (bmain) {
if ((flag & LIB_ID_FREE_NO_MAIN) == 0) {
BKE_main_unlock(bmain);
}