From 45621b0645ce8d1f470d08cd0e161edb73835ce3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 7 May 2014 17:29:28 +0200 Subject: [PATCH] Do a hard exit on crash --- qutebrowser/app.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 17fa736b1..e4e58a319 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -398,8 +398,6 @@ class QuteBrowser(QApplication): exc = (exctype, excvalue, tb) sys.__excepthook__(*exc) - self._quit_status['crash'] = False - if exctype is BdbQuit or not issubclass(exctype, Exception): # pdb exit, KeyboardInterrupt, ... try: @@ -407,6 +405,9 @@ class QuteBrowser(QApplication): return except Exception: self.quit() + + self._quit_status['crash'] = False + try: pages = self._recover_pages() except Exception: @@ -441,7 +442,9 @@ class QuteBrowser(QApplication): logging.debug("Running {} with args {}".format(sys.executable, argv)) subprocess.Popen(argv) - self._maybe_quit('crash') + # We might risk a segfault here, but that's better than continuing to + # run in some undefined state. + sys.exit(1) def _maybe_quit(self, sender): """Maybe quit qutebrowser.