Explicitely setPage to None in WebView's __del__.

This commit is contained in:
Florian Bruhin 2014-07-30 21:17:19 +02:00
parent d47f13e69b
commit 371c40f815

View File

@ -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."""