mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 03:45:56 +00:00
Patch another leak.
This commit is contained in:
parent
606766e0e8
commit
24483e4453
|
@ -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():
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user