Merge pull request #44109 from neikeq/fix-await-to-signal-many-at-once
C#: Fix multiple awaits to same signal result in connect error
This commit is contained in:
commit
83cdc9d7b7
|
@ -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) {
|
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 *a = static_cast<const SignalAwaiterCallable *>(p_a);
|
||||||
const SignalAwaiterCallable *b = static_cast<const SignalAwaiterCallable *>(p_b);
|
const SignalAwaiterCallable *b = static_cast<const SignalAwaiterCallable *>(p_b);
|
||||||
|
return a->awaiter_handle.handle == b->awaiter_handle.handle;
|
||||||
if (a->target_id != b->target_id) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (a->signal != b->signal) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SignalAwaiterCallable::compare_less(const CallableCustom *p_a, const CallableCustom *p_b) {
|
bool SignalAwaiterCallable::compare_less(const CallableCustom *p_a, const CallableCustom *p_b) {
|
||||||
|
|
Loading…
Reference in New Issue