fix: Don't let process continue running if the main app thread panics
This commit is contained in:
parent
50ba091ed0
commit
7418f60f8e
1 changed files with 10 additions and 1 deletions
|
|
@ -87,7 +87,16 @@ where
|
|||
signals.extend(TERM_SIGNALS);
|
||||
let mut signals = SignalsInfo::<WithOrigin>::new(signals).expect("Need signal info");
|
||||
|
||||
thread::spawn(app_exec);
|
||||
thread::spawn(|| {
|
||||
let app = thread::spawn(app_exec);
|
||||
|
||||
if matches!(app.join(), Ok(())) {
|
||||
expect_exit::exit_unwind(0);
|
||||
} else {
|
||||
error!("App thread panic!");
|
||||
expect_exit::exit_unwind(1);
|
||||
}
|
||||
});
|
||||
|
||||
let mut has_terminal = true;
|
||||
for info in &mut signals {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue