diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-14 16:59:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-14 16:59:34 +0300 |
commit | 965f872c3e932247a26170d49738e1dea14c18d6 (patch) | |
tree | 9339801ce0c9901b372df54e6f182640589bf25e /source/blender/editors | |
parent | d2a09da73f101553d0f4de8f1124396a65a64d5d (diff) |
Fix for memory leak and perhaps other issues on switching space types
in an area, the handlers (UI and keymap) were not removed.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/screen/area.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 1097062c526..066b110e457 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -504,13 +504,18 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space) /* *********** Space switching code, local now *********** */ /* XXX make operator for this */ -static void newspace(ScrArea *sa, int type) +static void newspace(bContext *C, ScrArea *sa, int type) { if(sa->spacetype != type) { - SpaceType *st= BKE_spacetype_from_id(type); - SpaceLink *slold= sa->spacedata.first; + SpaceType *st; + SpaceLink *slold; SpaceLink *sl; - + + ED_area_exit(C, sa); + + st= BKE_spacetype_from_id(type); + slold= sa->spacedata.first; + sa->spacetype= type; sa->butspacetype= type; @@ -594,7 +599,7 @@ static char *windowtype_pup(void) static void spacefunc(struct bContext *C, void *arg1, void *arg2) { - newspace(C->area, C->area->butspacetype); + newspace(C, C->area, C->area->butspacetype); WM_event_add_notifier(C, WM_NOTE_SCREEN_CHANGED, 0, NULL); } |