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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user