diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-10-06 16:27:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-10-06 16:36:39 +0300 |
commit | 84713629877d84d8c973d55e7e7cb0eca0f2ba49 (patch) | |
tree | db12b860677dd59f3e3ffddb71c670de7aeb36d3 /source/blender/windowmanager/intern/wm_files.c | |
parent | 867c49b962fed324b41492e4cbaf586b5020e2dd (diff) |
WM: Fix crash when a new window can't be created
Report an error instead of crashing if a new window can't be created
(typically caused by bad drivers).
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index d08c6c59a7f..fc5cad6d057 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -438,7 +438,14 @@ void wm_file_read_report(bContext *C) static void wm_file_read_post(bContext *C, bool is_startup_file) { bool addons_loaded = false; - CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); + wmWindowManager *wm = CTX_wm_manager(C); + + if (!G.background) { + /* remove windows which failed to be added via WM_check */ + wm_window_ghostwindows_remove_invalid(C, wm); + } + + CTX_wm_window_set(C, wm->windows.first); ED_editors_init(C); DAG_on_visible_update(CTX_data_main(C), true); |