Skip to content

Commit

Permalink
EditorResourcePreview: Let loads complete after exit requested
Browse files Browse the repository at this point in the history
(cherry picked from commit f31867d)
  • Loading branch information
RandomShaper committed Sep 13, 2024
1 parent 899c5af commit 8124bbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/editor_resource_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,10 @@ void EditorResourcePreview::stop() {
}

while (!exited.is_set()) {
// Sync pending work.
OS::get_singleton()->delay_usec(10000);
RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on rendering server
RenderingServer::get_singleton()->sync();
MessageQueue::get_singleton()->flush();
}

thread.wait_to_finish();
Expand Down

0 comments on commit 8124bbf

Please sign in to comment.