diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-14 17:13:31 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-14 17:13:31 +0200 |
commit | 75eb8ad51022765a9cf80ed7edc2bcc6287d09da (patch) | |
tree | 48bf49c0e1c5f35c27b6f1b0193b95c60741786d | |
parent | 08a21fda8dd7faa51b27fea1accfe942be55883e (diff) | |
parent | b6994a414d997fa180f22780ccd14476a9c00adb (diff) | |
download | redot-engine-75eb8ad51022765a9cf80ed7edc2bcc6287d09da.tar.gz |
Merge pull request #93091 from RandomShaper/remove_false_safety
Remove no longer needed thread safety measures
-rw-r--r-- | core/io/resource.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/core/io/resource.cpp b/core/io/resource.cpp index 1ecfd8366d..c045c0fc74 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -40,12 +40,7 @@ #include <stdio.h> void Resource::emit_changed() { - if (ResourceLoader::is_within_load() && !Thread::is_main_thread()) { - // Let the connection happen on the main thread, later, since signals are not thread-safe. - call_deferred("emit_signal", CoreStringName(changed)); - } else { - emit_signal(CoreStringName(changed)); - } + emit_signal(CoreStringName(changed)); } void Resource::_resource_path_changed() { @@ -166,22 +161,12 @@ bool Resource::editor_can_reload_from_file() { } void Resource::connect_changed(const Callable &p_callable, uint32_t p_flags) { - if (ResourceLoader::is_within_load() && !Thread::is_main_thread()) { - // Let the check and connection happen on the main thread, later, since signals are not thread-safe. - callable_mp(this, &Resource::connect_changed).call_deferred(p_callable, p_flags); - return; - } if (!is_connected(CoreStringName(changed), p_callable) || p_flags & CONNECT_REFERENCE_COUNTED) { connect(CoreStringName(changed), p_callable, p_flags); } } void Resource::disconnect_changed(const Callable &p_callable) { - if (ResourceLoader::is_within_load() && !Thread::is_main_thread()) { - // Let the check and disconnection happen on the main thread, later, since signals are not thread-safe. - callable_mp(this, &Resource::disconnect_changed).call_deferred(p_callable); - return; - } if (is_connected(CoreStringName(changed), p_callable)) { disconnect(CoreStringName(changed), p_callable); } |