2.5 - Fixed crashes when closing windows

This commit is contained in:
2008-12-11 23:05:18 +00:00
parent b7426ab4e2
commit 6f6eee0923
2 changed files with 14 additions and 6 deletions

View File

@@ -3530,17 +3530,21 @@ static int ui_handler_region(bContext *C, wmEvent *event)
static void ui_handler_remove_region(bContext *C)
{
bScreen *sc;
ARegion *ar;
ar= C->region;
if(ar==NULL) return;
if(ar == NULL) return;
uiFreeBlocks(C, &ar->uiblocks);
sc= C->screen;
if(sc == NULL) return;
/* delayed apply callbacks, but not for screen level regions, those
* we rather do at the very end after closing them all, which will
* be done in ui_handler_region/window */
if(BLI_findindex(&C->screen->regionbase, ar) == -1)
if(BLI_findindex(&sc->regionbase, ar) == -1)
ui_apply_but_funcs_after(C);
}