Fix T103101: random Cycles animation rendering freezing up the application
This commit is contained in:
@@ -1046,14 +1046,19 @@ bool RE_engine_render(Render *re, bool do_all)
|
||||
re->engine = engine;
|
||||
}
|
||||
|
||||
/* create render result */
|
||||
/* Create render result. Do this before acquiring lock, to avoid lock
|
||||
* 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);
|
||||
|
||||
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
||||
if (re->result == nullptr || !(re->r.scemode & R_BUTS_PREVIEW)) {
|
||||
if (create_new_result) {
|
||||
if (re->result) {
|
||||
render_result_free(re->result);
|
||||
}
|
||||
|
||||
re->result = engine_render_create_result(re);
|
||||
re->result = new_result;
|
||||
}
|
||||
BLI_rw_mutex_unlock(&re->resultmutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user