diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-06-08 08:57:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-08 09:02:57 +0300 |
commit | b54e95a5c8dcb7eae1059af107a7cdfa028d7e2e (patch) | |
tree | 9f2f977f16f8dbd52d490f0acbba4b4a53a1b155 /source/blender/editors | |
parent | 22a4fcb146c73ec922d959a33774f5a83cad4adb (diff) |
Alternative fix copying windows from popup dialogs
It could still crash if the window was freed and another was activated. see T44688.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 11 |
2 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 0b400e254f8..ef0a57fed75 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -401,7 +401,7 @@ void UI_popup_block_invoke_ex(struct bContext *C, uiBlockCreateFunc func, void * void UI_popup_block_ex(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg); /* void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); */ /* UNUSED */ -void UI_popup_block_close(struct bContext *C, uiBlock *block); +void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block); /* Blocks * diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 9835f0885b6..da2852c71d1 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -3049,16 +3049,11 @@ void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int } #endif -void UI_popup_block_close(bContext *C, uiBlock *block) +void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block) { - 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 (block->handle) { + if (block->handle) { + if (win) { UI_popup_handlers_remove(&win->modalhandlers, block->handle); ui_popup_block_free(C, block->handle); } |