summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-07-29 21:05:31 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-07-29 21:05:31 -0300
commitac52eb444f868b14db9eac4d29a10d2fc40919c0 (patch)
tree2dd036f2773ef9bbfa37b30c125a2a9b83d45af6
parent95a9e51975e2bf1c2a72cc124db1f713af90db7a (diff)
Ensure one shot signals are not disconnected while edited, closes #7776
-rw-r--r--core/object.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/object.cpp b/core/object.cpp
index 8c9d3557f8..a0c64feb09 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1209,7 +1209,15 @@ Error Object::emit_signal(const StringName &p_name, const Variant **p_args, int
}
}
- if (c.flags & CONNECT_ONESHOT) {
+ bool disconnect = c.flags & CONNECT_ONESHOT;
+#ifdef TOOLS_ENABLED
+ if (disconnect && (c.flags & CONNECT_PERSIST) && Engine::get_singleton()->is_editor_hint()) {
+ //this signal was connected from the editor, and is being edited. just dont disconnect for now
+ disconnect = false;
+ }
+#endif
+ if (disconnect) {
+
_ObjectSignalDisconnectData dd;
dd.signal = p_name;
dd.target = target;