fix for using enter on menus which load files:
authorCampbell Barton <ideasman42@gmail.com>
Sat, 23 Apr 2011 03:31:27 +0000 (03:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 23 Apr 2011 03:31:27 +0000 (03:31 +0000)
 commonly Ctrl+N,Enter or Ctrl+O,Enter

source/blender/windowmanager/intern/wm_event_system.c

index 6b074029984f57911d1d981a9efdfd1a0406f500..feff0393b8830e5ff6da2f5bd26f371510988d89 100644 (file)
@@ -1537,6 +1537,12 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
                        }
                }
                
+               /* XXX fileread case, if the wm is freed then the handler's
+                * will have been too so the code below need not run. */
+               if(CTX_wm_window(C)==NULL) {
+                       return action;
+               }
+
                /* XXX code this for all modal ops, and ensure free only happens here */
                
                /* modal ui handler can be tagged to be freed */ 
@@ -1546,10 +1552,6 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
                                wm_event_free_handler(handler);
                        }
                }
-               
-               /* XXX fileread case */
-               if(CTX_wm_window(C)==NULL)
-                       return action;
        }
 
        /* test for CLICK event */