Fix T103671: memory leak in material preview render

Introduced with the fix for T103101.
This commit is contained in:
Brecht Van Lommel 2023-01-06 16:04:03 +01:00
parent 3b37538975
commit 5cc793912e
Notes: blender-bot 2023-02-14 05:04:52 +01:00
Referenced by issue #103671, Regression: Memory leak: Something with materials slots
Referenced by issue #103372, Memory leak when adjusting material properties in Rendered view
1 changed files with 1 additions and 1 deletions

View File

@ -1049,7 +1049,7 @@ bool RE_engine_render(Render *re, bool do_all)
* inversion as this calls python to get the render passes, while python UI
* code can also hold a lock on the render result. */
const bool create_new_result = (re->result == nullptr || !(re->r.scemode & R_BUTS_PREVIEW));
RenderResult *new_result = engine_render_create_result(re);
RenderResult *new_result = (create_new_result) ? engine_render_create_result(re) : nullptr;
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
if (create_new_result) {