Patch another leak.

This commit is contained in:
Nolan Darilek 2019-12-23 09:59:12 -06:00
parent 606766e0e8
commit 24483e4453
2 changed files with 9 additions and 1 deletions

View File

@ -489,12 +489,17 @@ func focused():
TTS.speak(node.hint_tooltip, false) TTS.speak(node.hint_tooltip, false)
spoke_hint_tooltip = false spoke_hint_tooltip = false
var timer
func unfocused(): func unfocused():
print_debug("Unfocused") print_debug("Unfocused")
position_in_children = 0 position_in_children = 0
yield(node.get_tree().create_timer(1), "timeout") timer = node.get_tree().create_timer(1)
yield(timer, "timeout")
if not node.get_focus_owner(): if not node.get_focus_owner():
node.get_tree().root.warp_mouse(node.rect_global_position) node.get_tree().root.warp_mouse(node.rect_global_position)
timer.unreference()
timer = null
func click_focused(): func click_focused():
if node.has_focus(): if node.has_focus():

View File

@ -78,4 +78,7 @@ func _enter_tree():
func _exit_tree(): func _exit_tree():
for accessible in accessibles: for accessible in accessibles:
if accessible.timer != null:
accessible.timer.unreference()
accessible.timer = null
accessible.free() accessible.free()