diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-26 14:32:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-26 14:32:20 +0300 |
commit | c0475a785931ed0c5690ca5b3f6f5fa2db0ec237 (patch) | |
tree | 5027a06ab413148267777df607bca5986d177303 | |
parent | 5006875f53114b248f54a23ffb4fe88d14e7e654 (diff) |
2.5: fix/workaround for crashes with open recent popup, due
to usage of free'd area/region.
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index e74cb9b573e..b9bc38c5927 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -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; |