diff --git a/app/render/previewautocacher.cpp b/app/render/previewautocacher.cpp index e876ddafa..2bf3dcaca 100644 --- a/app/render/previewautocacher.cpp +++ b/app/render/previewautocacher.cpp @@ -193,6 +193,17 @@ void PreviewAutoCacher::VideoRendered() { RenderTicketWatcher* watcher = static_cast(sender()); + // Process passthroughs no matter what, if the viewer was switched, the passthrough map would be + // cleared anyway + QVector tickets = video_immediate_passthroughs_.take(watcher); + foreach (RenderTicketPtr t, tickets) { + if (watcher->HasResult()) { + t->Finish(watcher->Get()); + } else { + t->Finish(); + } + } + // If the task list doesn't contain this watcher, presumably it was cleared as a result of a // viewer switch, so we'll completely ignore this watcher auto it = video_tasks_.find(watcher); @@ -214,17 +225,6 @@ void PreviewAutoCacher::VideoRendered() TryRender(); } - // Process passthroughs no matter what, if the viewer was switched, the passthrough map would be - // cleared anyway - QVector tickets = video_immediate_passthroughs_.take(watcher); - foreach (RenderTicketPtr t, tickets) { - if (watcher->HasResult()) { - t->Finish(watcher->Get()); - } else { - t->Finish(); - } - } - delete watcher; }