From ee2c7658592d65030c76178267d04ac63213b2d9 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Tue, 26 Jun 2018 14:45:38 +1200 Subject: [PATCH] greasemonkey: check _widget is not deleted Just for good luck. No crash has been reported here but it is a common pattern for functions called from signals. --- qutebrowser/browser/webengine/webenginetab.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index d3d497ec7..8734a4b04 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -908,6 +908,9 @@ class _WebEngineScripts(QObject): remove_first: Whether to remove all previously injected scripts before adding these ones. """ + if sip.isdeleted(self._widget): + return + # Since we are inserting scripts into a per-tab collection, # rather than just injecting scripts on page load, we need to # make sure we replace existing scripts, not just add new ones.