- closing the user prefs accessed the temp screen after removing it.

- colorband drawing could use un-initialized vars (probably wouldnt crash)
This commit is contained in:
Campbell Barton 2009-12-26 00:17:45 +00:00
parent fb4f78513e
commit 266271d65a
2 changed files with 4 additions and 3 deletions

@ -698,7 +698,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *wcol, rcti *rect)
float x1, y1, sizex, sizey;
float dx, v3[2], v1[2], v2[2], v1a[2], v2a[2];
int a;
float pos, colf[4];
float pos, colf[4]= {0,0,0,0}; /* initialize incase the colorband isnt valid */
coba= (ColorBand *)(but->editcoba? but->editcoba: but->poin);
if(coba==NULL) return;

@ -1124,13 +1124,14 @@ void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
/* mark it available for use for other windows */
screen->winid= 0;
/* before deleting the temp screen or we get invalid access */
CTX_wm_window_set(C, prevwin);
/* if temp screen, delete it */
if(screen->full == SCREENTEMP) {
Main *bmain= CTX_data_main(C);
free_libblock(&bmain->screen, screen);
}
CTX_wm_window_set(C, prevwin);
}
/* *********************************** */