From 5dacfa10d51fff2aad1ce8873eafddcd88e325a9 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Tue, 30 Mar 2021 16:07:41 -0700 Subject: [PATCH] Stop resize thread on first sender error --- cursive/src/backends/resize.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cursive/src/backends/resize.rs b/cursive/src/backends/resize.rs index 3172049..016c49c 100644 --- a/cursive/src/backends/resize.rs +++ b/cursive/src/backends/resize.rs @@ -17,7 +17,9 @@ pub fn start_resize_thread( while resize_running.load(Ordering::Relaxed) { // We know it will only contain SIGWINCH signals, so no need to check. if signals.wait().count() > 0 { - resize_sender.send(()).unwrap(); + if resize_sender.send(()).is_err() { + return; + } } } });