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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-04-23 19:59:35 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-04-23 20:02:48 +0400
commit210dc12b530b0a2f3d74469ec6d93514ce2682d5 (patch)
tree84ab1f928c777c9e8c5753da0c86908ba5a167b6 /source/blender
parentad6d897d98ce8c8ad31c37da7f4faafbbb11ef95 (diff)
Fix T39847: Followup to rB6babb4d12b8b.
As suggested by Campbell, bump subversion and reset all ui_previews data (so that any file that could have been corrupted in past two weeks because of this bug is fixed and valid again).
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenloader/intern/versioning_270.c24
2 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 2cc17f30846..009cff4e3ae 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 270
-#define BLENDER_SUBVERSION 3
+#define BLENDER_SUBVERSION 4
/* 262 was the last editmesh release but it has compatibility code for bmesh data */
#define BLENDER_MINVERSION 262
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index a09b02eca78..507d711ce9e 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -46,6 +46,7 @@
#include "DNA_genfile.h"
+#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BKE_main.h"
@@ -180,6 +181,29 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
+ if (!MAIN_VERSION_ATLEAST(main, 270, 4)) {
+ /* ui_previews were not handled correctly when copying areas, leading to corrupted files (see T39847).
+ * This will always reset situation to a valid state.
+ */
+ bScreen *sc;
+
+ for (sc = main->screen.first; sc; sc = sc->id.next) {
+ ScrArea *sa;
+ for (sa = sc->areabase.first; sa; sa = sa->next) {
+ SpaceLink *sl;
+
+ for (sl = sa->spacedata.first; sl; sl = sl->next) {
+ ARegion *ar;
+ ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+
+ for (ar = lb->first; ar; ar = ar->next) {
+ BLI_listbase_clear(&ar->ui_previews);
+ }
+ }
+ }
+ }
+ }
+
if (!DNA_struct_elem_find(fd->filesdna, "Material", "int", "mode2")) { /* will be replaced with version check when other new flag is added to mode2 */
Material *ma;