2.5 internal bugfix: remove modal handlers before exiting the screen,

since these may be using it.
This commit is contained in:
Brecht Van Lommel
2009-11-23 11:49:23 +00:00
parent e0fc6d0c33
commit f8d40d2da0
3 changed files with 6 additions and 3 deletions

View 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);
}

View 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);
}
}

View 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);