diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-19 03:18:16 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-19 03:18:16 +0300 |
commit | dfb8b21340e63334c0ec67333bccc93166e303d1 (patch) | |
tree | cc0da6d9e4b5490df353baab98f3fa2037138867 | |
parent | 9178dc859638815ec38d9b95d2df723892c1af38 (diff) |
2.5: fix for crash reading regions of inactive spaces in an area.
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 23 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 3 |
2 files changed, 19 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 7e30be90b5e..94c11e9d2e1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4143,6 +4143,15 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene) } } +static void direct_link_region(FileData *fd, ARegion *ar) +{ + ar->handlers.first= ar->handlers.last= NULL; + ar->uiblocks.first= ar->uiblocks.last= NULL; + ar->regiondata= NULL; + ar->swinid= 0; + ar->type= NULL; +} + static void direct_link_screen(FileData *fd, bScreen *sc) { ScrArea *sa; @@ -4212,6 +4221,11 @@ static void direct_link_screen(FileData *fd, bScreen *sc) } for (sl= sa->spacedata.first; sl; sl= sl->next) { + link_list(fd, &(sl->regionbase)); + + for(ar= sl->regionbase.first; ar; ar= ar->next) + direct_link_region(fd, ar); + if (sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; v3d->bgpic= newdataadr(fd, v3d->bgpic); @@ -4275,13 +4289,8 @@ static void direct_link_screen(FileData *fd, bScreen *sc) } } - for(ar= sa->regionbase.first; ar; ar= ar->next) { - ar->handlers.first= ar->handlers.last= NULL; - ar->uiblocks.first= ar->uiblocks.last= NULL; - ar->regiondata= NULL; - ar->swinid= 0; - ar->type= NULL; - } + for(ar= sa->regionbase.first; ar; ar= ar->next) + direct_link_region(fd, ar); sa->actionzones.first= sa->actionzones.last= NULL; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index d06ffe44465..1c44217bde0 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1651,6 +1651,9 @@ static void write_screens(WriteData *wd, ListBase *scrbase) sl= sa->spacedata.first; while(sl) { + for(ar= sl->regionbase.first; ar; ar= ar->next) + writestruct(wd, DATA, "ARegion", 1, ar); + if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D *) sl; writestruct(wd, DATA, "View3D", 1, v3d); |