From 748de85ba2cc7bd8557a87fce88aab0ac3f3ad27 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 20 Jan 2018 18:50:17 +0100 Subject: [PATCH] Fix crash when getting signals for closed tabs Fixes #3498 --- qutebrowser/browser/browsertab.py | 4 ++++ qutebrowser/browser/webengine/webenginetab.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/qutebrowser/browser/browsertab.py b/qutebrowser/browser/browsertab.py index db251bf45..324895100 100644 --- a/qutebrowser/browser/browsertab.py +++ b/qutebrowser/browser/browsertab.py @@ -749,6 +749,10 @@ class AbstractTab(QWidget): @pyqtSlot(bool) def _on_load_finished(self, ok): + if sip.isdeleted(self._widget): + # https://github.com/qutebrowser/qutebrowser/issues/3498 + return + sess_manager = objreg.get('session-manager') sess_manager.save_autosave() diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 136270238..0523972df 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -631,6 +631,9 @@ class WebEngineTab(browsertab.AbstractTab): @pyqtSlot() def _restore_zoom(self): + if sip.isdeleted(self._widget): + # https://github.com/qutebrowser/qutebrowser/issues/3498 + return if self._saved_zoom is None: return self.zoom.set_factor(self._saved_zoom)