From 8fdf168ac0e1fd6e2ce041abd3a8869fb5225261 Mon Sep 17 00:00:00 2001 From: Paul Mairo Date: Sat, 22 Jul 2023 16:01:05 +0200 Subject: [PATCH] quitter: fix prompt_queue being None at shudown When pressing C-c if qutebrowser is not fully started yet, the prompt_queue is not initialized and prompts for an annoying crash report. Fixes #6827 --- doc/changelog.asciidoc | 3 ++- qutebrowser/misc/quitter.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index b8bce1545..7eece0317 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -159,7 +159,7 @@ Changed the correct PID (rather than always showing the latest process, which might not be the failing one) - When a process got killed with `SIGTERM`, no error message is now displayed - anymore (unless started with `:spawn --verbose`). + anymore (unless started with `:spawn --verbose`). - When a process got killed by a signal, the signal name is now displayed in the message. - The qute-pass will now try looking up candidate pass entries based on the @@ -188,6 +188,7 @@ Fixed - Multiple rare crashes when quitting qutebrowser. - The `asciidoc2html.py` script now correctly uses the virtualenv-installed asciidoc rather than requiring a system-wide installation. +- Crash when shutting down before fully initialized - Crash with some notification servers when the server is quitting. - Crash when using QtWebKit with PAC and the file has an invalid encoding. - Crash with the "tiramisu" notification server. diff --git a/qutebrowser/misc/quitter.py b/qutebrowser/misc/quitter.py index 59e2d552f..3396dbe51 100644 --- a/qutebrowser/misc/quitter.py +++ b/qutebrowser/misc/quitter.py @@ -219,7 +219,8 @@ class Quitter(QObject): status, session)) sessions.shutdown(session, last_window=last_window) - prompt.prompt_queue.shutdown() + if prompt.prompt_queue is not None: + prompt.prompt_queue.shutdown() # If shutdown was called while we were asking a question, we're in # a still sub-eventloop (which gets quit now) and not in the main