1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Cleanup function state connections when destroying instance

Co-authored-by: Adam Scott <ascott.ca@gmail.com>
This commit is contained in:
kobewi
2022-09-16 17:42:06 +02:00
parent cd491c6e47
commit e9a3e49086
3 changed files with 22 additions and 2 deletions

View File

@@ -296,6 +296,15 @@ void GDScriptFunctionState::_clear_stack() {
}
}
void GDScriptFunctionState::_clear_connections() {
List<Object::Connection> conns;
get_signals_connected_to_this(&conns);
for (Object::Connection &c : conns) {
c.signal.disconnect(c.callable);
}
}
void GDScriptFunctionState::_bind_methods() {
ClassDB::bind_method(D_METHOD("resume", "arg"), &GDScriptFunctionState::resume, DEFVAL(Variant()));
ClassDB::bind_method(D_METHOD("is_valid", "extended_check"), &GDScriptFunctionState::is_valid, DEFVAL(false));