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>2019-02-19 07:18:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-19 08:17:21 +0300
commitf88ea20285891d516c91c976239f95994f73abf3 (patch)
treeef07c2513dcfc688d9c6cdd2fa8aa2fdf8b98d32 /source/blender/windowmanager/intern/wm.c
parenteae2942474fa06b369b3fc6ebdeddad90ca38d43 (diff)
WM: move operator handler to it's own type
Diffstat (limited to 'source/blender/windowmanager/intern/wm.c')
-rw-r--r--source/blender/windowmanager/intern/wm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index ce309284ff0..72b906ce853 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -197,17 +197,17 @@ void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
wmWindow *win;
for (win = wm->windows.first; win; win = win->next) {
ListBase *lb[2] = {&win->handlers, &win->modalhandlers};
- wmEventHandler *handler;
- int i;
-
- for (i = 0; i < 2; i++) {
- for (handler = lb[i]->first; handler; handler = handler->next) {
- if (handler->op && handler->op->type == ot) {
- /* don't run op->cancel because it needs the context,
- * assume whoever unregisters the operator will cleanup */
- handler->flag |= WM_HANDLER_DO_FREE;
- WM_operator_free(handler->op);
- handler->op = NULL;
+ for (int i = 0; i < ARRAY_SIZE(lb); i++) {
+ for (wmEventHandler *handler_base = lb[i]->first; handler_base; handler_base = handler_base->next) {
+ if (handler_base->type == WM_HANDLER_TYPE_OP) {
+ wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
+ if (handler->op && handler->op->type == ot) {
+ /* don't run op->cancel because it needs the context,
+ * assume whoever unregisters the operator will cleanup */
+ handler->base.flag |= WM_HANDLER_DO_FREE;
+ WM_operator_free(handler->op);
+ handler->op = NULL;
+ }
}
}
}