rendertask: always wait for watchers to finish

I don't know why this wasn't written to do this before, perhaps I thought waiting for the thread would achieve this goal. Anyway, in my testing, this ensures render jobs are complete before the task returns.

Fixes #1899
Fixes #1900
This commit is contained in:
itsmattkc
2022-05-05 09:39:52 -07:00
parent ac7ff774e0
commit fd692e6910
+5
View File
@@ -266,9 +266,14 @@ bool RenderTask::Render(ColorManager* manager,
if (IsCancelled() || !result) {
// Cancel every watcher we created
foreach (RenderTicketWatcher* watcher, running_watchers_) {
watcher->Cancel();
disconnect(watcher, &RenderTicketWatcher::Finished, this, &RenderTask::TicketDone);
RenderManager::instance()->RemoveTicket(watcher->GetTicket());
}
foreach (RenderTicketWatcher* watcher, running_watchers_) {
watcher->WaitForFinished();
}
}
watcher_thread.quit();