From e3ddf3d44acc4d3f965278d01de6ca7fa3d646d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Thu, 12 Sep 2024 11:37:07 +0200 Subject: [PATCH 1/2] ResourceLoader: Fixup resource changed feature (no. 2) --- core/io/resource_loader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index f29f9eef98d..94f6caf6eb8 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -860,7 +860,7 @@ Ref ResourceLoader::_load_complete_inner(LoadToken &p_load_token, Erro } } core_bind::Semaphore done; - MessageQueue::get_main_singleton()->push_callable(callable_mp(&done, &core_bind::Semaphore::post)); + MessageQueue::get_main_singleton()->push_callable(callable_mp(&done, &core_bind::Semaphore::post).bind(1)); done.wait(); } } From f31867d2b9e7b916e24683c024764bcc3d326a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Fri, 13 Sep 2024 12:19:06 +0200 Subject: [PATCH 2/2] EditorResourcePreview: Let loads complete after exit requested --- editor/editor_resource_preview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 956fdc5cfa7..a50b2f3dccc 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -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();