From e1000adbe5febc0f2b4e35a88b2633ad100ed883 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Fri, 1 Mar 2024 22:42:37 +1300 Subject: [PATCH] feat(pty): call _close() on NOTIFICATION_EXIT_TREE --- addons/godot_xterm/native/src/pty.cpp | 7 +++---- addons/godot_xterm/native/src/pty.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) 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;