2.5: fix/workaround for crashes with open recent popup, due
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 26 Dec 2008 11:32:20 +0000 (11:32 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 26 Dec 2008 11:32:20 +0000 (11:32 +0000)
to usage of free'd area/region.

source/blender/windowmanager/intern/wm_event_system.c

index e74cb9b573e1e968716da49881b6c4fa6541593d..b9bc38c5927d0d558c2439dba8910dee273c8c16 100644 (file)
@@ -568,8 +568,15 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve
        retval= handler->ui_handle(C, event, handler->ui_userdata);
 
        /* putting back screen context */
-       CTX_wm_area_set(C, area);
-       CTX_wm_region_set(C, region);
+       if((retval != WM_UI_HANDLER_BREAK) || wm_event_always_pass(event)) {
+               CTX_wm_area_set(C, area);
+               CTX_wm_region_set(C, region);
+       }
+       else {
+               /* this special cases is for areas and regions that get removed */
+               CTX_wm_area_set(C, NULL);
+               CTX_wm_region_set(C, NULL);
+       }
 
        if(retval == WM_UI_HANDLER_BREAK)
                return WM_HANDLER_BREAK;