From 1c4500082fbb1dcb844adf3e140de0c61a3bffa5 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 4 Mar 2018 19:29:18 -0800 Subject: [PATCH] don't accumulate lingering zombies after closing a tab --- src/xwindows/xwin.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xwindows/xwin.rs b/src/xwindows/xwin.rs index b73e44d4e..635c08b66 100644 --- a/src/xwindows/xwin.rs +++ b/src/xwindows/xwin.rs @@ -28,6 +28,14 @@ struct Tab { pty: RefCell, } +impl Drop for Tab { + fn drop(&mut self) { + // Avoid lingering zombies + self.process.borrow_mut().kill().ok(); + self.process.borrow_mut().wait().ok(); + } +} + struct Tabs { tabs: Vec, active: usize,