diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 6 | ||||
-rw-r--r-- | source/blender/render/extern/include/RE_pipeline.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 14 |
3 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 26c59129914..b8df30c5de9 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -78,6 +78,7 @@ #include "BKE_screen.h" #include "BKE_sequencer.h" #include "BKE_sound.h" +#include "RE_pipeline.h" #include "BLO_undofile.h" @@ -199,6 +200,11 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, const char *filepath recover= (G.fileflags & G_FILE_RECOVER); + /* Free all render results, without this stale data gets displayed after loading files */ + if (mode != 'u') { + RE_FreeAllRenderResults(); + } + /* Only make filepaths compatible when loading for real (not undo) */ if (mode != 'u') { clean_paths(bfd->main); diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index b81066201e7..315995475e9 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -165,6 +165,8 @@ void RE_InitRenderCB(struct Render *re); void RE_FreeRender (struct Render *re); /* only called on exit */ void RE_FreeAllRender (void); +/* only call on file load */ +void RE_FreeAllRenderResults(void); /* get results and statistics */ void RE_FreeRenderResult(struct RenderResult *rr); diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 5db59fcdcc0..a4a244daf43 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -410,6 +410,20 @@ void RE_FreeAllRender(void) } } +/* on file load, free all re */ +void RE_FreeAllRenderResults(void) +{ + Render *re; + + for (re = RenderGlobal.renderlist.first; re; re = re->next) { + render_result_free(re->result); + render_result_free(re->pushedresult); + + re->result = NULL; + re->pushedresult = NULL; + } +} + /* ********* initialize state ******** */ |