diff options
Diffstat (limited to 'source/blender/blenkernel/intern/lib_id_delete.c')
-rw-r--r-- | source/blender/blenkernel/intern/lib_id_delete.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_id_delete.c b/source/blender/blenkernel/intern/lib_id_delete.c index 7c96d0a6401..b4f2caac861 100644 --- a/source/blender/blenkernel/intern/lib_id_delete.c +++ b/source/blender/blenkernel/intern/lib_id_delete.c @@ -24,6 +24,7 @@ /* all types are needed here, in order to do memory operations */ #include "DNA_ID.h" +#include "DNA_key_types.h" #include "BLI_utildefines.h" @@ -32,6 +33,7 @@ #include "BKE_anim_data.h" #include "BKE_idprop.h" #include "BKE_idtype.h" +#include "BKE_key.h" #include "BKE_lib_id.h" #include "BKE_lib_override.h" #include "BKE_lib_remap.h" @@ -146,6 +148,13 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i BKE_libblock_relink_ex(bmain, id, NULL, NULL, 0); } + if ((flag & LIB_ID_FREE_NO_MAIN) == 0) { + Key *key = BKE_key_from_id(id); + if (key != NULL) { + BKE_id_free_ex(bmain, &key->id, flag, use_flag_from_idtag); + } + } + BKE_libblock_free_datablock(id, flag); /* avoid notifying on removed data */ |