From fc7caee37054f1c480aa60a69270a33399cabc66 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 5 Feb 2014 11:40:30 +0100 Subject: [PATCH] Crash more reliably (lol'd) --- qutebrowser/app.py | 8 +++----- qutebrowser/widgets/__init__.py | 1 + 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 2c979f18d..25a59fc5a 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -4,6 +4,7 @@ import os import sys import logging import traceback +import subprocess import faulthandler from signal import signal, SIGINT from argparse import ArgumentParser @@ -148,6 +149,7 @@ class QuteBrowser(QApplication): except Exception: history = [] + QApplication.closeAllWindows() dlg = CrashDialog(pages, history, exc) ret = dlg.exec_() if ret == QDialog.Accepted: # restore @@ -157,11 +159,7 @@ class QuteBrowser(QApplication): argv = [sys.executable] + sys.argv + pages logging.debug('Running {} with args {}'.format(sys.executable, argv)) - config.config.save() - sys.stdout.flush() - # FIXME this seems broken on Windows, execv() splits on whitespace - # in arguments?!? - os.execv(sys.executable, argv) + subprocess.Popen(argv) self.exit(1) def _python_hacks(self): diff --git a/qutebrowser/widgets/__init__.py b/qutebrowser/widgets/__init__.py index 68828c263..a36ab3be3 100644 --- a/qutebrowser/widgets/__init__.py +++ b/qutebrowser/widgets/__init__.py @@ -16,6 +16,7 @@ class CrashDialog(QDialog): super().__init__() self.setFixedSize(500, 350) self.setWindowTitle('Whoops!') + self.setModal(True) vbox = QVBoxLayout() lbl = QLabel(self)