diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-22 01:01:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-22 01:01:58 +0400 |
commit | ff7088088f63a2cfb4ab9b2219c29afe751dfed8 (patch) | |
tree | 0afafd702798e0c1014b7a2bae9b042266620a1a /source | |
parent | d8623da305b81523f938b0cc0ebc942670cf0b97 (diff) |
fix issue with own recent commit - was accessing freed 'wm' on loading files.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 095a6bae966..1c446346dc1 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -806,9 +806,10 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P if(WM_operator_poll(C, ot)) { wmOperator *op= wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */ + const short is_nested_call = (wm->op_undo_depth != 0); /* initialize setting from previous run */ - if(wm->op_undo_depth == 0) { /* not called by py script */ + if(!is_nested_call) { /* not called by py script */ WM_operator_last_properties_init(op); } @@ -852,7 +853,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P if(retval & OPERATOR_HANDLED) ; /* do nothing, wm_operator_exec() has been called somewhere */ else if(retval & OPERATOR_FINISHED) { - if (wm->op_undo_depth == 0) { /* not called by py script */ + if (!is_nested_call) { /* not called by py script */ WM_operator_last_properties_store(op); } wm_operator_finished(C, op, 0); |