2.5
authorTon Roosendaal <ton@blender.org>
Wed, 3 Dec 2008 15:49:41 +0000 (15:49 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 3 Dec 2008 15:49:41 +0000 (15:49 +0000)
Fix crashing in pop-up menus when click.
There's something wrong still in handling menu itself, need Brecht
too look at that... probably a wrong return value somewhere.

source/blender/editors/interface/interface_ops.c

index 61b7475eca220ff9022f6bcced3b89b4efa2ee49..c68ea719a13f9442508a249c9be88b04c5414844 100644 (file)
@@ -2941,10 +2941,11 @@ static int button_activate_modal(bContext *C, wmOperator *op, wmEvent *event)
                                }
 
                                break;
+                       default:
+                               handled= ui_do_button(C, block, but, event);
                        }
                }
 
-               handled= ui_do_button(C, block, but, event);
        }
        else if(data->state == BUTTON_STATE_WAIT_RELEASE) {
                switch(event->type) {
@@ -3248,6 +3249,10 @@ static int menu_block_handle_modal(bContext *C, wmOperator *op, wmEvent *event)
        ar= bhandle->region;
        block= ar->uiblocks.first;
 
+       /* XXX (for brecht) this happens when click on menu */
+       if(block==NULL)
+               return OPERATOR_FINISHED;
+       
        act= 0;
        handled= 0;