From 86cfbeec6a7f683f988239ca08df5622abada4ea Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 Feb 2015 20:02:54 +1100 Subject: [PATCH] Partial fix for T43740 ED_area_data_swap would put the screen in an invalid state and crash. (SpaceLink.spacetype didn't match ScrArea.type) However behavior is still odd in the instance of the report. --- source/blender/editors/screen/area.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 4225b4bbd6e..c0878fea8ac 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1522,10 +1522,10 @@ void ED_area_data_copy(ScrArea *sa_dst, ScrArea *sa_src, const bool do_free) void ED_area_data_swap(ScrArea *sa_dst, ScrArea *sa_src) { - sa_dst->headertype = sa_src->headertype; - sa_dst->spacetype = sa_src->spacetype; - sa_dst->type = sa_src->type; - sa_dst->butspacetype = sa_src->butspacetype; + SWAP(short, sa_dst->headertype, sa_src->headertype); + SWAP(char, sa_dst->spacetype, sa_src->spacetype); + SWAP(SpaceType *, sa_dst->type, sa_src->type); + SWAP(char, sa_dst->butspacetype, sa_src->butspacetype); SWAP(ListBase, sa_dst->spacedata, sa_src->spacedata);