diff --git a/Accessible.gd b/Accessible.gd index be3cd15..c7d5b54 100644 --- a/Accessible.gd +++ b/Accessible.gd @@ -634,3 +634,9 @@ func _process(delta): if node.is_inside_tree() and not node.get_focus_owner(): node.get_tree().root.warp_mouse(node.rect_global_position) timer = null + +func free(): + if timer: + timer.unreference() + timer = null + .free() diff --git a/ScreenReader.gd b/ScreenReader.gd index 6e40813..c4208a1 100644 --- a/ScreenReader.gd +++ b/ScreenReader.gd @@ -86,6 +86,11 @@ func _enter_tree(): connect("swipe_up", self, "swipe_up") connect("swipe_down", self, "swipe_down") +func _exit_tree(): + for accessible in accessibles: + accessible.free() + accessibles = [] + func press_and_release(action): var event = InputEventAction.new() event.action = action