Eliminate warnings about disconnection of nonexistent timeout signal.

This commit is contained in:
Nolan Darilek 2019-12-27 12:04:09 -06:00
parent b5a83e1c25
commit aea75e961e

View File

@ -496,9 +496,8 @@ func unfocused():
position_in_children = 0 position_in_children = 0
timer = weakref(node.get_tree().create_timer(1)) timer = weakref(node.get_tree().create_timer(1))
yield(timer.get_ref(), "timeout") yield(timer.get_ref(), "timeout")
if not node.get_focus_owner(): if node.is_inside_tree() and 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.get_ref().unreference()
func click_focused(): func click_focused():
if node.has_focus(): if node.has_focus():
@ -629,4 +628,5 @@ func _init(node):
func _exit_tree(): func _exit_tree():
if timer != null and timer.get_ref(): if timer != null and timer.get_ref():
timer.get_ref().emit_signal("timeout")
timer.get_ref().unreference() timer.get_ref().unreference()