Stupid me! I was calling the subversion warning test *after* memory got
freed. Windows nicely crashes then. Also: added human readable string in fileglobal, so you can check the subversion in a file manually too. Rule: - Find GLOB chunk (first chunk after REND now) - skip sizeof BHead, 20 bytes in 32bits, or 24 in 64 bits - there's 4 characters showing subversion, right now it reads " 1".
This commit is contained in:
@@ -451,7 +451,7 @@ int BKE_read_file(char *dir, void *type_r)
|
||||
|
||||
setup_app_data(bfd, dir);
|
||||
|
||||
handle_subversion_warning(bfd->main);
|
||||
handle_subversion_warning(G.main);
|
||||
}
|
||||
else {
|
||||
error("Loading %s failed: %s", dir, BLO_bre_as_string(bre));
|
||||
|
@@ -1837,17 +1837,19 @@ static void write_brushes(WriteData *wd, ListBase *idbase)
|
||||
static void write_global(WriteData *wd)
|
||||
{
|
||||
FileGlobal fg;
|
||||
|
||||
|
||||
fg.curscreen= G.curscreen;
|
||||
fg.curscene= G.scene;
|
||||
fg.displaymode= G.displaymode;
|
||||
fg.winpos= G.winpos;
|
||||
fg.fileflags= (G.fileflags & ~G_FILE_NO_UI); // prevent to save this, is not good convention, and feature with concerns...
|
||||
fg.globalf= G.f;
|
||||
/* note, this will print byte nr 5, but that's corrected */
|
||||
sprintf(fg.subvstr, "%4d", BLENDER_SUBVERSION);
|
||||
fg.subversion= BLENDER_SUBVERSION;
|
||||
fg.minversion= BLENDER_MINVERSION;
|
||||
fg.minsubversion= BLENDER_MINSUBVERSION;
|
||||
|
||||
|
||||
writestruct(wd, GLOB, "FileGlobal", 1, &fg);
|
||||
}
|
||||
|
||||
|
@@ -39,14 +39,14 @@
|
||||
* the moment of saving, and the file-specific settings.
|
||||
*/
|
||||
typedef struct FileGlobal {
|
||||
void *curscreen;
|
||||
void *curscene;
|
||||
short displaymode, winpos;
|
||||
int fileflags;
|
||||
int globalf;
|
||||
int pad;
|
||||
char subvstr[4]; /* needs to be here, for human fileformat recognition */
|
||||
short subversion, pads;
|
||||
short minversion, minsubversion;
|
||||
short displaymode, winpos;
|
||||
void *curscreen;
|
||||
void *curscene;
|
||||
int fileflags;
|
||||
int globalf;
|
||||
} FileGlobal;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user