[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17933] branches/blender2.5/blender/source /blender/blenloader/intern: 2.5: fix for crash reading regions of inactive spaces in an area.
Brecht Van Lommel
brecht at blender.org
Fri Dec 19 01:18:17 CET 2008
Revision: 17933
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17933
Author: blendix
Date: 2008-12-19 01:18:16 +0100 (Fri, 19 Dec 2008)
Log Message:
-----------
2.5: fix for crash reading regions of inactive spaces in an area.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c
Modified: branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 2008-12-18 23:34:19 UTC (rev 17932)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c 2008-12-19 00:18:16 UTC (rev 17933)
@@ -4143,6 +4143,15 @@
}
}
+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 @@
}
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 @@
}
}
- 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;
Modified: branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c 2008-12-18 23:34:19 UTC (rev 17932)
+++ branches/blender2.5/blender/source/blender/blenloader/intern/writefile.c 2008-12-19 00:18:16 UTC (rev 17933)
@@ -1651,6 +1651,9 @@
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);
More information about the Bf-blender-cvs
mailing list