mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
Prevent exit callback instance leaks
De-references pty_baton's exit callback after it is called so it can be automatically released, preventing leaked instances. Adds basic implementation for Pipe's get_status() method and forces PTY to wait for child process to exit to ensure exit callback is cleaned up. Adds a test to check that exit callback is still called as usual.
This commit is contained in:
parent
38927e0a3e
commit
0ae1d80abb
5 changed files with 24 additions and 4 deletions
|
@ -73,6 +73,12 @@ func test_closes_pty_on_exit():
|
|||
assert_eq(new_num_pts, num_pts)
|
||||
|
||||
|
||||
func test_emits_exited_signal_when_child_process_exits():
|
||||
pty.call_deferred("fork", "exit")
|
||||
yield(yield_to(pty, "exited", 1), YIELD)
|
||||
assert_signal_emitted(pty, "exited")
|
||||
|
||||
|
||||
class Helper:
|
||||
static func _get_pts() -> Array:
|
||||
assert(false, "Abstract method")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue