Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-06-02 11:57:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-06-02 12:01:24 +0300
commit95b9d6d9c2063426a0051363a7de0214b8e89cc1 (patch)
treec65292211641ce6376de0aef1f3993e8048cc67f
parent5f5e05b3eb4c6a06acec764cc8ffc3441c5d0d51 (diff)
Fix operator exec /w popups that close the window
Related to T44688, note supporting this case isn't so nice, but seems it can be made to work.
-rw-r--r--source/blender/editors/interface/interface_regions.c11
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);
}