diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-11 11:48:04 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-11 11:48:04 +0300 |
commit | 13beeb58922747cc1a28bac58ceb1b44820808cd (patch) | |
tree | 34a2cb3d3d728015e680ab165d37883ff6a48fcd /source/blender/blenkernel/intern/image.c | |
parent | 0385b33f0b3e389ea2a82c4b6bb181c684f0511a (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/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index e8b5ce77613..8fd672963c7 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -3133,9 +3133,11 @@ static void image_create_multilayer(Image *ima, ImBuf *ibuf, int framenr) /* common stuff to do with images after loading */ static void image_initialize_after_load(Image *ima, ImBuf *ibuf) { - /* preview is NULL when it has never been used as an icon before */ - if (G.background == 0 && ima->preview == NULL) + /* Preview is NULL when it has never been used as an icon before. + * Never handle previews/icons outside of main thread. */ + if (G.background == 0 && ima->preview == NULL && BLI_thread_is_main()) { BKE_icon_changed(BKE_icon_id_ensure(&ima->id)); + } /* fields */ if (ima->flag & IMA_FIELDS) { |