From 50ea5681794e1494d5b293539ff52ba3ca78c349 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 31 Aug 2007 23:23:38 +0000 Subject: Bugfix for [#7018] Hiding, unhiding a spot lamp and then setting it to buf shadow segfaults buttons were not redrawing so it was possible to use them without an active object, this crashed blender. --- source/blender/src/editobject.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/blender/src') diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index c4736a84837..757ca322bdd 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -5486,14 +5486,17 @@ int object_data_is_libdata(Object *ob) void hide_objects(int select) { Base *base; - int changed = 0; + short changed = 0, changed_act = 0; for(base = FIRSTBASE; base; base=base->next){ if(TESTBASELIB(base)==select){ base->flag &= ~SELECT; base->object->flag = base->flag; base->object->restrictflag |= OB_RESTRICT_VIEW; changed = 1; - if (base==BASACT) BASACT= NULL; + if (base==BASACT) { + BASACT= NULL; + changed_act = 1; + } } } if (changed) { @@ -5502,6 +5505,12 @@ void hide_objects(int select) DAG_scene_sort(G.scene); allqueue(REDRAWVIEW3D,0); allqueue(REDRAWOOPS,0); + allqueue(REDRAWDATASELECT,0); + if (changed_act) { /* these spaces depend on the active object */ + allqueue(REDRAWBUTSALL,0); + allqueue(REDRAWIPO,0); + allqueue(REDRAWACTION,0); + } countall(); } } -- cgit v1.2.3