diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-06-14 00:37:37 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-06-14 00:37:37 +0300 |
commit | 0095f4f83465bc9fdc13b79d2126f5623e291d7c (patch) | |
tree | 271e524fa33bc6d223e93492a36d58261cf96e48 /source/blender | |
parent | be4cf933abfef8c5e8ee02e04a236e414bc11287 (diff) |
Fix T51794: Crash on hair file when opening with no UI
Just a workaround for now.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/blendfile.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 9e244246e16..111dc98476f 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -332,7 +332,17 @@ static void setup_app_data( } } } - BKE_scene_set_background(G.main, curscene); + + if (mode == LOAD_UI_OFF && BLI_listbase_is_empty(&G.main->wm)) { + /* XXX prevent crash in pdInitEffectors called through DEG_scene_relations_rebuild (see T51794). + * Can be removed once BKE_scene_layer_context_active_ex gets workspace passed. */ + BLI_addhead(&G.main->wm, CTX_wm_manager(C)); + BKE_scene_set_background(G.main, curscene); + BLI_listbase_clear(&G.main->wm); + } + else { + BKE_scene_set_background(G.main, curscene); + } if (mode != LOAD_UNDO) { RE_FreeAllPersistentData(); |