From 371c40f81593084e3f79d0cd60bd65d5aa6eb8f8 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 30 Jul 2014 21:17:19 +0200 Subject: [PATCH] Explicitely setPage to None in WebView's __del__. --- qutebrowser/widgets/webview.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qutebrowser/widgets/webview.py b/qutebrowser/widgets/webview.py index 47e69f09a..3d8d266f5 100644 --- a/qutebrowser/widgets/webview.py +++ b/qutebrowser/widgets/webview.py @@ -121,6 +121,13 @@ class WebView(QWebView): url = self.url().toDisplayString() return "WebView(url='{}')".format(elide(url, 50)) + def __del__(self): + # Explicitely releasing the page here seems to prevent some segfaults + # when quitting. + # Copied from: + # https://code.google.com/p/webscraping/source/browse/webkit.py#325 + self.setPage(None) + @property def open_target(self): """Getter for open_target so we can define a setter."""