Revision: 17848
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17848
Author:   blendix
Date:     2008-12-14 14:59:34 +0100 (Sun, 14 Dec 2008)

Log Message:
-----------
Fix for memory leak and perhaps other issues on switching space types
in an area, the handlers (UI and keymap) were not removed.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/screen/area.c

Modified: branches/blender2.5/blender/source/blender/editors/screen/area.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/area.c    
2008-12-14 13:55:31 UTC (rev 17847)
+++ branches/blender2.5/blender/source/blender/editors/screen/area.c    
2008-12-14 13:59:34 UTC (rev 17848)
@@ -504,13 +504,18 @@
 /* *********** 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 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);
 }
 


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to