- closing the user prefs accessed the temp screen after removing it.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 26 Dec 2009 00:17:45 +0000 (00:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 26 Dec 2009 00:17:45 +0000 (00:17 +0000)
- colorband drawing could use un-initialized vars (probably wouldnt crash)

source/blender/editors/interface/interface_draw.c
source/blender/editors/screen/screen_edit.c

index e6e5cb198aafc94d01e1a0502d648adb7fc94e0e..0602ca656b91f63b76ef931cedfddc1110db1bd7 100644 (file)
@@ -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;
index 6bf01a69d126e51c5397de7c581192bfc1956f59..f0003669a123a40b354848c6a60b147b253b1b13 100644 (file)
@@ -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);
 }
 
 /* *********************************** */