Merge pull request #109517 from precup/speedy-signal-disconnect

Speed up signal disconnects in the editor
This commit is contained in:
Thaddeus Crews 2025-10-30 10:45:56 -05:00
commit 416ba9a1c6
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
4 changed files with 22 additions and 4 deletions

View file

@ -1522,6 +1522,18 @@ int Object::get_persistent_signal_connection_count() const {
return count;
}
uint32_t Object::get_signal_connection_flags(const StringName &p_name, const Callable &p_callable) const {
OBJ_SIGNAL_LOCK
const SignalData *signal_data = signal_map.getptr(p_name);
if (signal_data) {
const SignalData::Slot *slot = signal_data->slot_map.getptr(p_callable);
if (slot) {
return slot->conn.flags;
}
}
return 0;
}
void Object::get_signals_connected_to_this(List<Connection> *p_connections) const {
OBJ_SIGNAL_LOCK

View file

@ -973,6 +973,7 @@ public:
DEBUG_VIRTUAL void get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const;
DEBUG_VIRTUAL void get_all_signal_connections(List<Connection> *p_connections) const;
DEBUG_VIRTUAL int get_persistent_signal_connection_count() const;
DEBUG_VIRTUAL uint32_t get_signal_connection_flags(const StringName &p_name, const Callable &p_callable) const;
DEBUG_VIRTUAL void get_signals_connected_to_this(List<Connection> *p_connections) const;
DEBUG_VIRTUAL Error connect(const StringName &p_signal, const Callable &p_callable, uint32_t p_flags = 0);