Fix #35470: crash rendering from the terminal in some cases due to render info

text threading issue.
This commit is contained in:
2013-07-12 20:31:30 +00:00
parent 99e97afbe3
commit 32586e6805
3 changed files with 8 additions and 15 deletions

View File

@@ -107,7 +107,7 @@ typedef struct RenderEngine {
struct Render *re;
ListBase fullresult;
char *text;
char text[512]; /* IMA_MAX_RENDER_TEXT */
int resolution_x, resolution_y;

View File

@@ -158,9 +158,6 @@ void RE_engine_free(RenderEngine *engine)
BLI_end_threaded_malloc();
}
if (engine->text)
MEM_freeN(engine->text);
MEM_freeN(engine);
}
@@ -307,17 +304,14 @@ void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char
}
/* set engine text */
if (engine->text) {
MEM_freeN(engine->text);
engine->text = NULL;
}
engine->text[0] = '\0';
if (stats && stats[0] && info && info[0])
engine->text = BLI_sprintfN("%s | %s", stats, info);
BLI_snprintf(engine->text, sizeof(engine->text), "%s | %s", stats, info);
else if (info && info[0])
engine->text = BLI_strdup(info);
BLI_strncpy(engine->text, info, sizeof(engine->text));
else if (stats && stats[0])
engine->text = BLI_strdup(stats);
BLI_strncpy(engine->text, info, sizeof(engine->text));
}
void RE_engine_update_progress(RenderEngine *engine, float progress)