diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-12-05 16:42:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-05 16:42:19 +0100 |
commit | 83cdc9d7b7ae4d90a3c6cb5dea3faff8ed137fd4 (patch) | |
tree | 1f7b5d133cc0fb50f7db40d55b61ccd37edf52d0 /modules/mono | |
parent | 45ecb21901fb8e9763add66bdc5ca971b2a2072f (diff) | |
parent | e2f703782404db36ca2909e89e79dc2ba9634b95 (diff) |
Merge pull request #44109 from neikeq/fix-await-to-signal-many-at-once
C#: Fix multiple awaits to same signal result in connect error
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/signal_awaiter_utils.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/modules/mono/signal_awaiter_utils.cpp b/modules/mono/signal_awaiter_utils.cpp index bd67b03c8e..28777002f5 100644 --- a/modules/mono/signal_awaiter_utils.cpp +++ b/modules/mono/signal_awaiter_utils.cpp @@ -48,18 +48,10 @@ Error gd_mono_connect_signal_awaiter(Object *p_source, const StringName &p_signa } bool SignalAwaiterCallable::compare_equal(const CallableCustom *p_a, const CallableCustom *p_b) { + // Only called if both instances are of type SignalAwaiterCallable. Static cast is safe. const SignalAwaiterCallable *a = static_cast<const SignalAwaiterCallable *>(p_a); const SignalAwaiterCallable *b = static_cast<const SignalAwaiterCallable *>(p_b); - - if (a->target_id != b->target_id) { - return false; - } - - if (a->signal != b->signal) { - return false; - } - - return true; + return a->awaiter_handle.handle == b->awaiter_handle.handle; } bool SignalAwaiterCallable::compare_less(const CallableCustom *p_a, const CallableCustom *p_b) { |