Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-05-11 11:48:04 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-05-11 11:48:04 +0300
commit13beeb58922747cc1a28bac58ceb1b44820808cd (patch)
tree34a2cb3d3d728015e680ab165d37883ff6a48fcd /source/blender/blenkernel/intern/icons.c
parent0385b33f0b3e389ea2a82c4b6bb181c684f0511a (diff)
Fix (unreported) load image code calling icin/preview update from non-Main thread.
Icin/preview only works in main thread, while image loading can be done from others too... This could have generated random crashes and such.
Diffstat (limited to 'source/blender/blenkernel/intern/icons.c')
-rw-r--r--source/blender/blenkernel/intern/icons.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 3ac8abd55f6..9483543f1f0 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -514,8 +514,12 @@ static int icon_id_ensure_create_icon(struct ID *id)
int BKE_icon_id_ensure(struct ID *id)
{
- if (!id || G.background)
+ /* Never handle icons in non-main thread! */
+ BLI_assert(BLI_thread_is_main());
+
+ if (!id || G.background) {
return 0;
+ }
if (id->icon_id)
return id->icon_id;