forked from bartvdbraak/blender
fix [#30653] Wrong image at UV/Image Editor window
render results would be displayed on loading new files if the scene names matches, now free render-results so as not to display stale data - also saves some memory.
This commit is contained in:
parent
4ade85612c
commit
ce4eb57301
@ -78,6 +78,7 @@
|
|||||||
#include "BKE_screen.h"
|
#include "BKE_screen.h"
|
||||||
#include "BKE_sequencer.h"
|
#include "BKE_sequencer.h"
|
||||||
#include "BKE_sound.h"
|
#include "BKE_sound.h"
|
||||||
|
#include "RE_pipeline.h"
|
||||||
|
|
||||||
|
|
||||||
#include "BLO_undofile.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);
|
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) */
|
/* Only make filepaths compatible when loading for real (not undo) */
|
||||||
if (mode != 'u') {
|
if (mode != 'u') {
|
||||||
clean_paths(bfd->main);
|
clean_paths(bfd->main);
|
||||||
|
@ -165,6 +165,8 @@ void RE_InitRenderCB(struct Render *re);
|
|||||||
void RE_FreeRender (struct Render *re);
|
void RE_FreeRender (struct Render *re);
|
||||||
/* only called on exit */
|
/* only called on exit */
|
||||||
void RE_FreeAllRender (void);
|
void RE_FreeAllRender (void);
|
||||||
|
/* only call on file load */
|
||||||
|
void RE_FreeAllRenderResults(void);
|
||||||
|
|
||||||
/* get results and statistics */
|
/* get results and statistics */
|
||||||
void RE_FreeRenderResult(struct RenderResult *rr);
|
void RE_FreeRenderResult(struct RenderResult *rr);
|
||||||
|
@ -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 ******** */
|
/* ********* initialize state ******** */
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user