Exit the process from the signal handler.

This commit is contained in:
Josh Matthews 2018-11-23 16:26:19 -05:00
parent d9b76ef7d0
commit 17850090a0
4 changed files with 5 additions and 5 deletions

View file

@ -49,6 +49,7 @@ glutin = "0.19"
keyboard-types = "0.4.3"
lazy_static = "1"
libservo = {path = "../../components/servo"}
libc = "0.2"
log = "0.4"
tinyfiledialogs = "3.0"
winit = {version = "0.18", features = ["icon_loading"]}

View file

@ -13,6 +13,7 @@ mod resources;
mod browser;
use backtrace::Backtrace;
use libc::_exit;
use servo::{Servo, BrowserId};
use servo::compositing::windowing::WindowEvent;
use servo::config::opts::{self, ArgumentParsingResult, parse_url_or_filename};
@ -42,7 +43,6 @@ fn install_crash_handler() {}
fn install_crash_handler() {
use backtrace::Backtrace;
use sig::ffi::Sig;
use std::intrinsics::abort;
use std::thread;
fn handler(_sig: i32) {
@ -52,9 +52,7 @@ fn install_crash_handler() {
.unwrap_or("".to_owned());
println!("Stack trace{}\n{:?}", name, Backtrace::new());
unsafe {
// N.B. Using process::abort() here causes the crash handler to be
// triggered recursively.
abort();
_exit(sig);
}
}