2.5 internal bugfix: remove modal handlers before exiting the screen,
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 23 Nov 2009 11:49:23 +0000 (11:49 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 23 Nov 2009 11:49:23 +0000 (11:49 +0000)
since these may be using it.

source/blender/editors/interface/interface_regions.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_window.c

index 388b83cff11bbaeb34fffbb55ae31e4032774339..2c4fb71af757c4338d7d9852e9d26c52f612dc47 100644 (file)
@@ -1321,9 +1321,7 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
 
 void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle)
 {
-       /* XXX ton added, chrash on load file with popup open... need investigate */
-       if(CTX_wm_screen(C))
-               ui_remove_temporary_region(C, CTX_wm_screen(C), handle->region);
+       ui_remove_temporary_region(C, CTX_wm_screen(C), handle->region);
        MEM_freeN(handle);
 }
 
index a150ca1f8a0b3091a85b2f373025858962016ab6..ba514f097e66fd003414f77424fc760fcc047600 100644 (file)
@@ -122,6 +122,8 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
                for(win= wm->windows.first; win; win= win->next) {
                
                        CTX_wm_window_set(C, win);      /* needed by operator close callbacks */
+                       WM_event_remove_handlers(C, &win->handlers);
+                       WM_event_remove_handlers(C, &win->modalhandlers);
                        ED_screen_exit(C, win, win->screen);
                }
        }
index dbc3d27be6afb6522b290cfd2b4ed6f9e0f084b4..78d70c96ad6956eb5e4bcba7d2dd5d13e9cbb9c0 100644 (file)
@@ -230,6 +230,9 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win)
        BLI_remlink(&wm->windows, win);
        
        wm_draw_window_clear(win);
+       CTX_wm_window_set(C, win);      /* needed by handlers */
+       WM_event_remove_handlers(C, &win->handlers);
+       WM_event_remove_handlers(C, &win->modalhandlers);
        ED_screen_exit(C, win, win->screen);
        wm_window_free(C, wm, win);