diff options
author | Saracen <SaracenOne@gmail.com> | 2023-09-24 13:43:10 +0100 |
---|---|---|
committer | Saracen <SaracenOne@gmail.com> | 2023-09-26 03:36:11 +0100 |
commit | 0b0a6109b6d8974899691fd1dd883eca994b769f (patch) | |
tree | 74f1eed6a37e9baef4c9331837f0427228e14098 /core | |
parent | fe5b1c8d49313d63fbe91cb7cdf463e10fb86afa (diff) | |
download | redot-engine-0b0a6109b6d8974899691fd1dd883eca994b769f.tar.gz |
Make notify_dependency_error only defer calls if called from secondary threads.
Diffstat (limited to 'core')
-rw-r--r-- | core/io/resource_loader.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index 0c7d6c0feb..3c32a19066 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -230,7 +230,11 @@ public: // Loaders can safely use this regardless which thread they are running on. static void notify_dependency_error(const String &p_path, const String &p_dependency, const String &p_type) { if (dep_err_notify) { - callable_mp_static(dep_err_notify).bind(p_path, p_dependency, p_type).call_deferred(); + if (Thread::get_caller_id() == Thread::get_main_id()) { + dep_err_notify(p_path, p_dependency, p_type); + } else { + callable_mp_static(dep_err_notify).bind(p_path, p_dependency, p_type).call_deferred(); + } } } static void set_dependency_error_notify_func(DependencyErrorNotify p_err_notify) { |