diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-28 14:47:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-28 14:49:45 +0300 |
commit | 704b336899dd0a308f9160fa53478d2aaed9f730 (patch) | |
tree | 4097de7c0770eb7eb984ec9fb86f273ac423b006 /source/blender/editors/space_info | |
parent | cb69a039e74b21ea2d5469b776719fbc9aea45ac (diff) |
Make scene statistics to respect locked interface
Interface is being locked when some destructive operations
are called from non-main thread.
This was causing crash with particles in T60065.
Diffstat (limited to 'source/blender/editors/space_info')
-rw-r--r-- | source/blender/editors/space_info/info_stats.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index de406ccdc59..23ef5076c93 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -38,6 +38,7 @@ #include "DNA_mesh_types.h" #include "DNA_meta_types.h" #include "DNA_scene_types.h" +#include "DNA_windowmanager_types.h" #include "BLI_listbase.h" #include "BLI_math.h" @@ -52,6 +53,7 @@ #include "BKE_displist.h" #include "BKE_key.h" #include "BKE_layer.h" +#include "BKE_main.h" #include "BKE_paint.h" #include "BKE_particle.h" #include "BKE_editmesh.h" @@ -597,8 +599,15 @@ void ED_info_stats_clear(ViewLayer *view_layer) } } -const char *ED_info_stats_string(Scene *scene, ViewLayer *view_layer) +const char *ED_info_stats_string(Main *bmain, Scene *scene, ViewLayer *view_layer) { + /* Loopin through dependency graph when interface is locked in not safe. + * Thew interface is marked as locked when jobs wants to modify the + * dependency graph. */ + wmWindowManager *wm = bmain->wm.first; + if (wm->is_interface_locked) { + return ""; + } Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, true); if (!view_layer->stats) { stats_update(depsgraph, view_layer); |