Skip to content

Commit

Permalink
EditorResourcePreview: Let loads complete after exit requested
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomShaper committed Sep 13, 2024
1 parent e3ddf3d commit f31867d
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 @@ -533,8 +533,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 f31867d

Please sign in to comment.