summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-01-13 17:03:00 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-01-13 17:03:02 +0100
commitf38bfccf42ccf16fd84cb8df41a19a2c3a0f4923 (patch)
treeee428834afcb93aed452fb09a60d70e3465e7de9
parent031b5455ae0d1f3c4c850ce91a1168b6aabc9537 (diff)
Object: Remove error on disconnect of locked signals
According to https://github.com/godotengine/godot/commit/22637beb2ed625c3e43ab75ab5865b57d7470948#commitcomment-36651823 and as confirmed by @reduz, this seems not to be necessary now that we copy-on-write. This triggered freeze scenarios in cases where a node would be deleted while being used as a target in a signal emission. Fixes #34650. Fixes #34769. Now those two errors go back to reporting: ``` ERROR: emit_signal: Condition ' !target ' is true. Continuing..: At: core/object.cpp:1191. ```
-rw-r--r--core/object.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/core/object.cpp b/core/object.cpp
index 35ccc38d4e..ba07ba11c5 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1519,10 +1519,6 @@ void Object::_disconnect(const StringName &p_signal, Object *p_to_object, const
Signal *s = signal_map.getptr(p_signal);
ERR_FAIL_COND_MSG(!s, vformat("Nonexistent signal '%s' in %s.", p_signal, to_string()));
- ERR_FAIL_COND_MSG(s->lock > 0,
- vformat("Attempt to disconnect %s signal '%s' while in emission callback '%s' (in target %s). Use CONNECT_DEFERRED (to be able to safely disconnect) or CONNECT_ONESHOT (for automatic disconnection) as connection flags.",
- to_string(), p_signal, p_to_method, p_to_object->to_string()));
-
Signal::Target target(p_to_object->get_instance_id(), p_to_method);
ERR_FAIL_COND_MSG(!s->slot_map.has(target), "Disconnecting nonexistent signal '" + p_signal + "', slot: " + itos(target._id) + ":" + target.method + ".");