Proper fix for User Preferences window crash
Reverts rBb9ae517794765d6a1660 and fixes the issue properly. Old fix could cause NULL to be passed to functions that expect all arguments to be non-NULL.
This commit is contained in:
parent
c00b42b710
commit
8851460174
|
@ -134,7 +134,7 @@ void ED_scene_change_update(
|
|||
CTX_data_eval_ctx(C, &eval_ctx_old);
|
||||
eObjectMode object_mode_old = workspace->object_mode;
|
||||
ViewLayer *layer_old = BKE_view_layer_from_workspace_get(scene_old, workspace);
|
||||
Object *obact_old = layer_old ? OBACT(layer_old) : NULL;
|
||||
Object *obact_old = OBACT(layer_old);
|
||||
bool obact_new_mode_exists = ED_object_mode_generic_exists(bmain->wm.first, obact_new, workspace->object_mode);
|
||||
|
||||
|
||||
|
|
|
@ -766,7 +766,11 @@ wmWindow *WM_window_open_temp(bContext *C, int x, int y, int sizex, int sizey, i
|
|||
WM_window_set_active_layout(win, workspace, layout);
|
||||
}
|
||||
|
||||
if (WM_window_get_active_scene(win) != scene) {
|
||||
if (win->scene == NULL) {
|
||||
win->scene = scene;
|
||||
}
|
||||
/* In case we reuse an already existing temp window (see win lookup above). */
|
||||
else if (WM_window_get_active_scene(win) != scene) {
|
||||
WM_window_change_active_scene(bmain, C, win, scene);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue