diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-15 11:23:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-15 11:24:53 +0300 |
commit | cbc7ee28d7fe145564ca6c398a99e0519d97010d (patch) | |
tree | 9d2b4fed13dab24be2b43bb55509d83df803769b /source/blender/blenkernel/intern/screen.c | |
parent | 3ee606621cf53a2a4897e534e7e04d3632f419f8 (diff) |
WM: 2.8 screen compatibility
Without these minor changes loading files from 2.8 will crash.
Manually applied edits from 26786a2b87a08
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index a719cc8c94a..995d22c9ba5 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -68,13 +68,17 @@ static void spacetype_free(SpaceType *st) for (art = st->regiontypes.first; art; art = art->next) { BLI_freelistN(&art->drawcalls); - for (pt = art->paneltypes.first; pt; pt = pt->next) - if (pt->ext.free) + for (pt = art->paneltypes.first; pt; pt = pt->next) { + if (pt->ext.free) { pt->ext.free(pt->ext.data); + } + } - for (ht = art->headertypes.first; ht; ht = ht->next) - if (ht->ext.free) + for (ht = art->headertypes.first; ht; ht = ht->next) { + if (ht->ext.free) { ht->ext.free(ht->ext.data); + } + } BLI_freelistN(&art->paneltypes); BLI_freelistN(&art->headertypes); @@ -199,10 +203,15 @@ ARegion *BKE_area_region_copy(SpaceType *st, ARegion *ar) if (ar->regiondata) { ARegionType *art = BKE_regiontype_from_id(st, ar->regiontype); - if (art && art->duplicate) + if (art && art->duplicate) { newar->regiondata = art->duplicate(ar->regiondata); - else + } + else if (ar->flag & RGN_FLAG_TEMP_REGIONDATA) { + newar->regiondata = NULL; + } + else { newar->regiondata = MEM_dupallocN(ar->regiondata); + } } if (ar->v2d.tab_offset) |