Bugfix #21262: Loading Alpha 0 project crash in Alpha 1
authorJoshua Leung <aligorith@gmail.com>
Mon, 1 Mar 2010 06:23:59 +0000 (06:23 +0000)
committerJoshua Leung <aligorith@gmail.com>
Mon, 1 Mar 2010 06:23:59 +0000 (06:23 +0000)
Old temp-pointers for File Browser instances were not being cleared on file load, resulting in crashes when trying to free temp screen layouts that contained file browser instance data.

source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c

index e0ec3b26b52f997c256999cf373a5f0abc93c457..fbf3c6f0ebeb02775f8b6e6edf69546353256be5 100644 (file)
@@ -5125,6 +5125,18 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
                                //      cl->line= newdataadr(fd, cl->line);
                                
                        }
+                       else if(sl->spacetype==SPACE_FILE) {
+                               SpaceFile *sfile= (SpaceFile *)sl;
+                               
+                               /* this sort of info is probably irrelevant for reloading...
+                                * plus, it isn't saved to files yet!
+                                */
+                               sfile->folders_prev= sfile->folders_next= NULL;
+                               sfile->files= NULL;
+                               sfile->layout= NULL;
+                               sfile->op= NULL;
+                               sfile->params= NULL;
+                       }
                }
                
                sa->actionzones.first= sa->actionzones.last= NULL;
index be374d153cdc73943d328743226c22f99034d8fa..22fcd28ca00d3933033abd967a55036b7d8be575 100644 (file)
@@ -2080,6 +2080,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
                                                write_curvemapping(wd, sima->cumap);
                                }
                                else if(sl->spacetype==SPACE_IMASEL) {
+                                       // XXX: depreceated... do we still want to keep this?
                                        writestruct(wd, DATA, "SpaceImaSel", 1, sl);
                                }
                                else if(sl->spacetype==SPACE_TEXT) {