diff options
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 99e4af62567..9835f0885b6 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -3051,11 +3051,14 @@ void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int void UI_popup_block_close(bContext *C, uiBlock *block) { - if (block->handle) { - wmWindow *win = CTX_wm_window(C); + wmWindow *win = CTX_wm_window(C); + + /* check window before 'block->handle' incase the + * popup execution closed the window and freed the block. see T44688. */ - /* if loading new .blend while popup is open, window will be NULL */ - if (win) { + /* if loading new .blend while popup is open, window will be NULL */ + if (win) { + if (block->handle) { UI_popup_handlers_remove(&win->modalhandlers, block->handle); ui_popup_block_free(C, block->handle); } |