2.5: Buttons View
[blender-staging.git] / source / blender / blenkernel / intern / screen.c
index c1f621274c00f0cbd5c7d7a1be98d2c9aa48a218..cc740d7fb3daccbd3992b332c624c1c40002d2e3 100644 (file)
@@ -179,6 +179,9 @@ ARegion *BKE_area_region_copy(SpaceType *st, ARegion *ar)
                else
                        newar->regiondata= MEM_dupallocN(ar->regiondata);
        }
+
+       if(ar->v2d.tab_offset)
+               newar->v2d.tab_offset= MEM_dupallocN(ar->v2d.tab_offset);
        
        newar->panels.first= newar->panels.last= NULL;
        BLI_duplicatelist(&newar->panels, &ar->panels);
@@ -271,10 +274,14 @@ void BKE_area_region_free(SpaceType *st, ARegion *ar)
        }
        else if(ar->type && ar->type->free)
                ar->type->free(ar);
+       
+       if(ar->v2d.tab_offset) {
+               MEM_freeN(ar->v2d.tab_offset);
+               ar->v2d.tab_offset= NULL;
+       }
 
-       if(ar) {
+       if(ar)
                BLI_freelistN(&ar->panels);
-       }
 }
 
 /* not area itself */