diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-02-14 01:05:04 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-02-14 01:05:04 +0400 |
commit | 19ff61bfb3c817ae5707bac1911c062eea98a292 (patch) | |
tree | f87bb7e2ae144611f112ac5702174994b0e6c648 /source | |
parent | a53237f1930553f0aa373f6f4a85d8ad30650411 (diff) |
Fix #30155: crash with popup menu open while new .blend file is loaded,
CTX_wm_window is then set to NULL and checked in the event queue, but it
should be checked for removing handlers too.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 360b58eb0a9..c912bce1c77 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2657,8 +2657,13 @@ void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int void uiPupBlockClose(bContext *C, uiBlock *block) { if(block->handle) { - UI_remove_popup_handlers(&CTX_wm_window(C)->modalhandlers, block->handle); - ui_popup_block_free(C, block->handle); + wmWindow *win = CTX_wm_window(C); + + /* if loading new .blend while popup is open, window will be NULL */ + if(win) { + UI_remove_popup_handlers(&win->modalhandlers, block->handle); + ui_popup_block_free(C, block->handle); + } } } |