diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-21 16:44:38 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-03-21 16:50:20 +0400 |
commit | c626462c0fe1257c07948b49db1a41526682ba3f (patch) | |
tree | 564141e615224f6f1e9d92873dd3b5ce3e9720e2 /source/blender/blenkernel/BKE_library.h | |
parent | 7148c97796723d9f074bdf5acd244be02c54b814 (diff) |
Fix T39209: Localizing materials could cause heisenbug with concurrent
depsgraph updates.
Material datablocks were localized by first making a regular datablock
copy, which always gets inserted into the bmain list, and then removing
it again from bmain.
Problem is that this localization happens in preview threads, which can
run while the depsgraph is also updating GPU materials. In case the
copying of materials takes any amount of time, this can cause the
depsgraph call to material_changed to use an invalid, localized material
and access invalid GPUMaterial lists which have already been freed for
the actual material.
Solution is to not add localized datablocks to the bmain lists in the
first place. bmain should be totally immutable during preview or render
threads.
Diffstat (limited to 'source/blender/blenkernel/BKE_library.h')
-rw-r--r-- | source/blender/blenkernel/BKE_library.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 5c92cc7b34b..44a9885cd87 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -49,6 +49,7 @@ struct PropertyRNA; void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void *BKE_libblock_copy_ex(struct Main *bmain, struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +void *BKE_libblock_copy_nolib(struct ID *id) ATTR_NONNULL(); void *BKE_libblock_copy(struct ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void BKE_libblock_copy_data(struct ID *id, const struct ID *id_from, const bool do_action); |