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:
authorCampbell Barton <ideasman42@gmail.com>2018-06-14 23:27:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-14 23:27:58 +0300
commit26786a2b87a08e239b7f255dc987ab70086bece0 (patch)
tree033d826ae5cdc946624639687d80e4c42ef6b7e9 /source/blender/blenloader
parent1adfabc8c62ed3f067d209511ce3d868e76c9bbd (diff)
WM: add support for temporary region data
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c15
-rw-r--r--source/blender/blenloader/intern/writefile.c4
2 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 2ec1aab3725..481acbb163d 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6431,6 +6431,10 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
/* unkown space type, don't leak regiondata */
ar->regiondata = NULL;
}
+ else if (ar->flag & RGN_FLAG_TEMP_REGIONDATA) {
+ /* Runtime data, don't use. */
+ ar->regiondata = NULL;
+ }
else {
ar->regiondata = newdataadr(fd, ar->regiondata);
if (ar->regiondata) {
@@ -7213,11 +7217,12 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map, Main
/* free render engines for now */
for (ar = sa->regionbase.first; ar; ar = ar->next) {
- RegionView3D *rv3d= ar->regiondata;
-
- if (rv3d && rv3d->render_engine) {
- RE_engine_free(rv3d->render_engine);
- rv3d->render_engine = NULL;
+ if (ar->regiontype == RGN_TYPE_WINDOW) {
+ RegionView3D *rv3d = ar->regiondata;
+ if (rv3d && rv3d->render_engine) {
+ RE_engine_free(rv3d->render_engine);
+ rv3d->render_engine = NULL;
+ }
}
}
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 71b13133230..0dafca67edc 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2687,6 +2687,10 @@ static void write_region(WriteData *wd, ARegion *ar, int spacetype)
writestruct(wd, DATA, ARegion, 1, ar);
if (ar->regiondata) {
+ if (ar->flag & RGN_FLAG_TEMP_REGIONDATA) {
+ return;
+ }
+
switch (spacetype) {
case SPACE_VIEW3D:
if (ar->regiontype == RGN_TYPE_WINDOW) {