diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-05 06:28:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-05 06:28:49 +0400 |
commit | 936a38c607de098e3b09c5c00337130ebdd47b44 (patch) | |
tree | 4e72fa079d65cb72a01702b53be9e5d6191f489a | |
parent | e9ef8d6effa0fa0d8b7d9a7764643d714c0ab2bd (diff) |
fix for valgrind warning - using uninitialized variable. Though in practice it didn't cause any problems.
Getting the 'CTX_data_main' while un-fullscreen'ing a space would do a context lookup into the view3d_context which had an uninitialized layer.
since view3d_context doesn't hold a 'main' member it never did anything but cleaner not to do context lookups while modifying the view.
- noticed while checking on a real bug :)
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index cca713ec14a..7c22dff1b01 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1337,13 +1337,14 @@ int ED_screen_area_active(const bContext *C) /* Do NOT call in area/region queues! */ void ED_screen_set(bContext *C, bScreen *sc) { + Main *bmain = CTX_data_main(C); wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); bScreen *oldscreen = CTX_wm_screen(C); ID *id; /* validate screen, it's called with notifier reference */ - for (id = CTX_data_main(C)->screen.first; id; id = id->next) + for (id = bmain->screen.first; id; id = id->next) if (sc == (bScreen *)id) break; if (id == NULL) @@ -1355,7 +1356,7 @@ void ED_screen_set(bContext *C, bScreen *sc) if (sc->full) { /* find associated full */ bScreen *sc1; - for (sc1 = CTX_data_main(C)->screen.first; sc1; sc1 = sc1->id.next) { + for (sc1 = bmain->screen.first; sc1; sc1 = sc1->id.next) { ScrArea *sa = sc1->areabase.first; if (sa->full == sc) { sc = sc1; |