diff --git a/addons/godot_xterm/native/src/pty.cpp b/addons/godot_xterm/native/src/pty.cpp index 10c8284..803f342 100644 --- a/addons/godot_xterm/native/src/pty.cpp +++ b/addons/godot_xterm/native/src/pty.cpp @@ -72,10 +72,6 @@ PTY::PTY() { #endif } -PTY::~PTY() { - _close(); -} - int PTY::get_cols() const { return cols; } @@ -202,6 +198,9 @@ void PTY::_notification(int p_what) { _run(UV_RUN_NOWAIT); } break; + case NOTIFICATION_EXIT_TREE: + _close(); + break; } } diff --git a/addons/godot_xterm/native/src/pty.h b/addons/godot_xterm/native/src/pty.h index 362c159..6ecef7a 100644 --- a/addons/godot_xterm/native/src/pty.h +++ b/addons/godot_xterm/native/src/pty.h @@ -40,7 +40,6 @@ namespace godot }; PTY(); - ~PTY(); Status status = STATUS_CLOSED;