diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-01-11 13:27:35 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-01-12 12:01:33 +0300 |
commit | 7a2b18159170b91694fd7c64825a699314fae3ca (patch) | |
tree | 8aa6542f0f7f2076e0d8d9b494a5c381fd475707 /source/blender/windowmanager/intern/wm_files.c | |
parent | ebad1d8d339dbcbe918738b493a52f803c538c95 (diff) |
Fix T94041: Loading a new file gives crash while rendering in viewport
The issue was caused by Cycles display driver not being able to restore
window's OpenGL context after disposing Cycles-side OpenGL context.
This is due to the window OpenGL re-activation needing to access window
manager which gets cleared out form global main during file reading.
Defer clearing window manager from the global main to until after all
screens are "exited". This allows Cycles to properly stop rendering,
dispose its OpenGL context, and restore window's drawable context.
It is unclear why it was required to clear window manager list early
on. Guess is that it comes from an original code in a1c8543f2ac where
there was an early return which then got replaced with an actual logic
without changing the order of de-initialization and window manager list
clear.
Differential Revision: https://developer.blender.org/D13799
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 99bab3ae23d..344f4959a93 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -193,7 +193,6 @@ bool wm_file_or_session_data_has_unsaved_changes(const Main *bmain, const wmWind static void wm_window_match_init(bContext *C, ListBase *wmlist) { *wmlist = G_MAIN->wm; - BLI_listbase_clear(&G_MAIN->wm); wmWindow *active_win = CTX_wm_window(C); @@ -220,6 +219,8 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist) } } + BLI_listbase_clear(&G_MAIN->wm); + /* reset active window */ CTX_wm_window_set(C, active_win); |