diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-15 10:47:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-15 10:47:58 +0300 |
commit | 20c25bffda0df4260e13bda697347ce830857b7a (patch) | |
tree | ec68fc90ef33bb2463c1f34cf6bb254cf91e9596 /source/blender/blenkernel | |
parent | 656692913beb0d47f41a21db53fc4c310e2fb203 (diff) | |
parent | 6a850f3cc840a574d3b5b5af7b608ae3536f96ec (diff) |
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_main.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_id.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_id_delete.c | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index b2472e862ec..29ec65166a9 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -105,6 +105,12 @@ typedef struct Main { */ char use_memfile_full_barrier; + /** + * When linking, disallow creation of new data-blocks. + * Make sure we don't do this by accident, see T76738. + */ + char is_locked_for_linking; + BlendThumbnail *blen_thumb; struct Library *curlib; diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index d8b63f0f527..9ef5c549235 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -963,6 +963,8 @@ void *BKE_libblock_alloc(Main *bmain, short type, const char *name, const int fl id->us = 1; } if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) { + /* Note that 2.8x versioning has tested not to cause conflicts. */ + BLI_assert(bmain->is_locked_for_linking == false || ELEM(type, ID_WS, ID_GR)); ListBase *lb = which_libbase(bmain, type); BKE_main_lock(bmain); diff --git a/source/blender/blenkernel/intern/lib_id_delete.c b/source/blender/blenkernel/intern/lib_id_delete.c index fdee5500fbd..7c96d0a6401 100644 --- a/source/blender/blenkernel/intern/lib_id_delete.c +++ b/source/blender/blenkernel/intern/lib_id_delete.c @@ -128,6 +128,8 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i const short type = GS(id->name); if (bmain && (flag & LIB_ID_FREE_NO_DEG_TAG) == 0) { + BLI_assert(bmain->is_locked_for_linking == false); + DEG_id_type_tag(bmain, type); } |