Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-02-07 23:07:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-07 23:24:05 +0400
commitb3afbcab8ff2330c1473647be330a3ffe9b11885 (patch)
treee86b9c7d9676e63b8da92da79889dee13b8be186 /source/blender/editors/interface/interface_handlers.c
parent1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff)
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index cf930d635a7..b5d7bbd022a 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -542,7 +542,7 @@ static void ui_apply_but_funcs_after(bContext *C)
/* copy to avoid recursive calls */
funcs = UIAfterFuncs;
- UIAfterFuncs.first = UIAfterFuncs.last = NULL;
+ BLI_listbase_clear(&UIAfterFuncs);
for (afterf = funcs.first; afterf; afterf = after.next) {
after = *afterf; /* copy to avoid memleak on exit() */
@@ -7906,8 +7906,9 @@ static int ui_handler_region(bContext *C, const wmEvent *event, void *UNUSED(use
ar = CTX_wm_region(C);
retval = WM_UI_HANDLER_CONTINUE;
- if (ar == NULL) return retval;
- if (ar->uiblocks.first == NULL) return retval;
+ if (ar == NULL || BLI_listbase_is_empty(&ar->uiblocks)) {
+ return retval;
+ }
/* either handle events for already activated button or try to activate */
but = ui_but_find_activated(ar);