[Bf-blender-cvs] [390a0d56247] master: Fix T82387: Crash loading file saved with recent master in old versions

Julian Eisel noreply at git.blender.org
Fri Nov 6 11:58:18 CET 2020


Commit: 390a0d562474134b3978aeb11535ea33ca8afb0e
Author: Julian Eisel
Date:   Fri Nov 6 11:52:55 2020 +0100
Branches: master
https://developer.blender.org/rB390a0d562474134b3978aeb11535ea33ca8afb0e

Fix T82387: Crash loading file saved with recent master in old versions

This fix makes sure new files save `wmWindow.global_areas` under a different
name, so old Blender versions don't recognize and 0-initialize it.

Since enabling global area writing (ef4aa42ea4ff), loading a file in old
Blender versions would cause `wmWindow.global_areas` to be read, because there
was already reading code for it and `ScrAreaMap` was in SDNA.
However the `ScrArea.global` of the global areas would be NULL, because it was
*not* in SDNA (`ScrGlobalAreaData` was excluded).
Now, issue is that the code assumes that areas in the global area-map have a
valid ScrArea.global pointer.

Think this was a mistake in rB5f6c45498c92. We should have cleared all this data
on reading, until the global area writing was enabled.

Differential Revision: https://developer.blender.org/D9442

Reviewed by: Brecht Van Lommel

===================================================================

M	source/blender/makesdna/intern/dna_rename_defs.h

===================================================================

diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h
index 7067caa60d9..2a4160bdfb1 100644
--- a/source/blender/makesdna/intern/dna_rename_defs.h
+++ b/source/blender/makesdna/intern/dna_rename_defs.h
@@ -126,3 +126,6 @@ DNA_STRUCT_RENAME_ELEM(bTheme, ttopbar, space_topbar)
 DNA_STRUCT_RENAME_ELEM(bTheme, tuserpref, space_preferences)
 DNA_STRUCT_RENAME_ELEM(bTheme, tv3d, space_view3d)
 DNA_STRUCT_RENAME_ELEM(RigidBodyWorld, steps_per_second, substeps_per_frame)
+/* Write with a different name, old Blender versions crash loading files with non-NULL
+ * global_areas. See D9442. */
+DNA_STRUCT_RENAME_ELEM(wmWindow, global_area_map, global_areas)



More information about the Bf-blender-cvs mailing list