diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-08-21 16:25:41 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-08-21 16:28:42 +0200 |
commit | 7c733e8e3ee8f6241ff4431452a7032f7f05d6cd (patch) | |
tree | 6395d94237bde430f49af8b40fa050f8e4d0aa11 | |
parent | 178e377867479fa85f96d00b0dd75652e1190db3 (diff) | |
download | qutebrowser-7c733e8e3ee8f6241ff4431452a7032f7f05d6cd.tar.gz qutebrowser-7c733e8e3ee8f6241ff4431452a7032f7f05d6cd.zip |
Don't try to hide deleted systray icon
-rw-r--r-- | doc/changelog.asciidoc | 2 | ||||
-rw-r--r-- | qutebrowser/browser/webengine/notification.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index c17763aa4..68b5a7502 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -31,6 +31,8 @@ Fixed - Switching tabs via mouse wheel scrolling now works properly on macOS. Set `tabs.mousewheel_switching` to false if you prefer the previous behavior. +- Speculative fix for a crash when closing qutebrowser while a systray + notification is shown. Changed ~~~~~~~ diff --git a/qutebrowser/browser/webengine/notification.py b/qutebrowser/browser/webengine/notification.py index 6b26157e6..e40b3e736 100644 --- a/qutebrowser/browser/webengine/notification.py +++ b/qutebrowser/browser/webengine/notification.py @@ -66,6 +66,7 @@ if TYPE_CHECKING: from qutebrowser.config import config from qutebrowser.misc import objects from qutebrowser.utils import qtutils, log, utils, debug, message, version +from qutebrowser.qt import sip bridge: Optional['NotificationBridgePresenter'] = None @@ -477,7 +478,9 @@ class SystrayNotificationAdapter(AbstractNotificationAdapter): @pyqtSlot(int) def on_web_closed(self, notification_id: int) -> None: assert notification_id == self.NOTIFICATION_ID, notification_id - self._systray.hide() + if not sip.isdeleted(self._systray): + # This can get called during shutdown + self._systray.hide() class MessagesNotificationAdapter(AbstractNotificationAdapter): |