Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2008-12-14 13:52:48 +0300
committerTon Roosendaal <ton@blender.org>2008-12-14 13:52:48 +0300
commit3a58eddec5d47973f19c1c6102fa3e45a27a71ba (patch)
tree19f33f95274d2a8f17154a11edc4bf4c12967945 /source/blender/blenloader
parent616ab233fa1d91453dd1790d7126bdc41dcb12f9 (diff)
2.5
The basics for InfoSpace. Also added InfoSpace data to area by default, older files allowed to have nothing here (space empty). (prevents reported crasher in switching space info to others). Also: added ifdeffed code in readfile.c to debug missing memory frees from data read from files. (instead of "data from SCR" it will print the actual struct names).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d62c4e62535..db6d6ba801e 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4206,8 +4206,12 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
sa->type= NULL; /* spacetype callbacks */
/* accident can happen when read/save new file with older version */
- if(sa->spacedata.first==NULL && sa->spacetype>SPACE_NLA)
- sa->spacetype= SPACE_EMPTY;
+ /* 2.50: we now always add spacedata for info */
+ if(sa->spacedata.first==NULL) {
+ SpaceInfo *sinfo= MEM_callocN(sizeof(SpaceInfo), "spaceinfo");
+ sa->spacetype= SPACE_INFO;
+ BLI_addtail(&sa->spacedata, sinfo);
+ }
for(pa= sa->panels.first; pa; pa=pa->next) {
pa->paneltab= newdataadr(fd, pa->paneltab);
@@ -4513,15 +4517,17 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, int flag, ID
while(bhead && bhead->code==DATA) {
void *data;
- /* XXX BAD DEBUGGING OPTION TO GIVE NAMES */
+#if 0
+ /* XXX DUMB DEBUGGING OPTION TO GIVE NAMES for guarded malloc errors */
short *sp= fd->filesdna->structs[bhead->SDNAnr];
char *allocname = fd->filesdna->types[ sp[0] ];
char *tmp= malloc(100);
strcpy(tmp, allocname);
-
data= read_struct(fd, bhead, tmp);
-
+#endif
+ data= read_struct(fd, bhead, allocname);
+
if (data) {
oldnewmap_insert(fd->datamap, bhead->old, data, 0);
}