From 131fa2e00c35ff78042a4f793891eaeb880d715c Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 14 Dec 2008 17:25:46 +0000 Subject: 2.5 Fix for crash on joining (previously splitted) areas. Reason was the stored regions in pushed 'spaces' not being copied. next: free running handlers on area join/split. --- source/blender/editors/include/ED_screen.h | 1 - source/blender/editors/screen/area.c | 19 ++----------------- source/blender/editors/screen/screen_ops.c | 2 +- .../blender/editors/space_outliner/space_outliner.c | 4 ++++ 4 files changed, 7 insertions(+), 19 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 7292cc87366..2cb394da2b0 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -46,7 +46,6 @@ void ED_region_do_draw(struct bContext *C, struct ARegion *ar); void ED_region_exit(struct bContext *C, struct ARegion *ar); void ED_region_pixelspace(const struct bContext *C, struct ARegion *ar); void ED_region_init(struct bContext *C, struct ARegion *ar); -ARegion *ED_region_copy(ARegion *ar); /* spaces */ void ED_spacetypes_init(void); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 066b110e457..fc6ed8cee54 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -431,21 +431,6 @@ void ED_region_init(bContext *C, ARegion *ar) } -ARegion *ED_region_copy(ARegion *ar) -{ - ARegion *newar= MEM_dupallocN(ar); - - newar->handlers.first= newar->handlers.last= NULL; - newar->uiblocks.first= newar->uiblocks.last= NULL; - newar->swinid= 0; - - /* XXX regiondata */ - if(ar->regiondata) - newar->regiondata= MEM_dupallocN(ar->regiondata); - - return newar; -} - /* sa2 to sa1, we swap spaces for fullscreen to keep all allocated data */ /* area vertices were set */ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space) @@ -485,11 +470,11 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space) } } - /* regions */ + /* regions... XXX */ BLI_freelistN(&sa1->regionbase); for(ar= sa2->regionbase.first; ar; ar= ar->next) { - ARegion *newar= ED_region_copy(ar); + ARegion *newar= BKE_area_region_copy(ar); BLI_addtail(&sa1->regionbase, newar); } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index e36e843b846..9a96edf243c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1208,7 +1208,7 @@ void ED_SCR_OT_repeat_last(wmOperatorType *ot) /* insert a region in the area region list */ static int region_split_exec(bContext *C, wmOperator *op) { - ARegion *newar= ED_region_copy(C->region); + ARegion *newar= BKE_area_region_copy(C->region); int dir= RNA_enum_get(op->ptr, "dir"); BLI_insertlinkafter(&C->area->regionbase, C->region, newar); diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index b53e5ce427d..923710d22b3 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -548,6 +548,10 @@ static SpaceLink *outliner_duplicate(SpaceLink *sl) if(soutlinern->rnapath) soutlinern->rnapath= MEM_dupallocN(soutlinern->rnapath); + soutlinern->oops.first= soutlinern->oops.last= NULL; + soutlinern->tree.first= soutlinern->tree.last= NULL; + soutlinern->treestore= NULL; + return (SpaceLink *)soutlinern; } -- cgit v1.2.3