diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-23 20:08:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-23 20:08:02 +0400 |
commit | 97bdec181145902292c41d6f559154c4ec5d06ee (patch) | |
tree | e9abe63b20f361acfde04bdcf26953fdbc96d754 | |
parent | 3217ecbc8e561e9f84aa732256323a5e9489f7cc (diff) |
fix for use of uninitialized variable with ui_handler_region_menu.
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index fed84092133..958334fb476 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6928,8 +6928,6 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(user { ARegion *ar; uiBut *but; - uiHandleButtonData *data; - int retval; /* here we handle buttons at the window level, modal, for example * while number sliding, text editing, or when a menu block is open */ @@ -6940,17 +6938,23 @@ static int ui_handler_region_menu(bContext *C, wmEvent *event, void *UNUSED(user but = ui_but_find_activated(ar); if (but) { + uiHandleButtonData *data; + /* handle activated button events */ data = but->active; if (data->state == BUTTON_STATE_MENU_OPEN) { + int retval; + /* handle events for menus and their buttons recursively, * this will handle events from the top to the bottom menu */ if (data->menu) retval = ui_handle_menus_recursive(C, event, data->menu, 0); /* handle events for the activated button */ - if (retval == WM_UI_HANDLER_CONTINUE || event->type == TIMER) { + if ((data->menu && (retval == WM_UI_HANDLER_CONTINUE)) || + (event->type == TIMER)) + { if (data->menu && data->menu->menuretval) ui_handle_button_return_submenu(C, event, but); else |