diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-26 03:17:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-26 03:17:45 +0300 |
commit | 266271d65a5aaeb0040848a2e288695b3e9ed7c9 (patch) | |
tree | 171f425d13e61ae9e0467c259b21628f5ba54404 | |
parent | fb4f78513e0cba6187646e950806f71cd42b7bae (diff) |
- closing the user prefs accessed the temp screen after removing it.
- colorband drawing could use un-initialized vars (probably wouldnt crash)
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index e6e5cb198aa..0602ca656b9 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -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; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 6bf01a69d12..f0003669a12 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -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); } /* *********************************** */ |