From 7b528b2a3ad33b3ad7328213669d8179528e254b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Jan 2021 11:33:33 +1100 Subject: Fix T84920: Crash undoing object activation in the outliner Regression from d8992192e5512380f57433df113f3e3f8b22f7cb The original code relied on having a separate edit-object pointer than the active object. Use a utility function to avoid code duplication as there are other areas that have similar functionality. --- source/blender/editors/space_outliner/outliner_select.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/blender/editors/space_outliner/outliner_select.c') diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index f8812ff5970..600047c4b11 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -398,14 +398,10 @@ static eOLDrawState tree_element_set_active_object(bContext *C, } if (set != OL_SETSEL_NONE) { - ED_object_base_activate(C, base); /* adds notifier */ + ED_object_base_activate_with_mode_exit_if_needed(C, base); /* adds notifier */ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); } - - if (ob != OBEDIT_FROM_VIEW_LAYER(view_layer)) { - ED_object_editmode_exit(C, EM_FREEDATA); - } } return OL_DRAWSEL_NORMAL; } -- cgit v1.2.3