2.5 - Fixed crashes when closing windows
This commit is contained in:
@@ -164,15 +164,19 @@ void BKE_screen_area_free(ScrArea *sa)
|
||||
/* don't free screen itself */
|
||||
void free_screen(bScreen *sc)
|
||||
{
|
||||
ScrArea *sa;
|
||||
ARegion *ar;
|
||||
ScrArea *sa, *san;
|
||||
ARegion *ar, *arn;
|
||||
|
||||
for(ar=sc->regionbase.first; ar; ar=ar->next)
|
||||
for(ar=sc->regionbase.first; ar; ar=arn) {
|
||||
arn= ar->next;
|
||||
BKE_area_region_free(ar);
|
||||
}
|
||||
BLI_freelistN(&sc->regionbase);
|
||||
|
||||
for(sa= sc->areabase.first; sa; sa= sa->next)
|
||||
for(sa= sc->areabase.first; sa; sa= san) {
|
||||
san= sa->next;
|
||||
BKE_screen_area_free(sa);
|
||||
}
|
||||
|
||||
BLI_freelistN(&sc->vertbase);
|
||||
BLI_freelistN(&sc->edgebase);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user