Shut down NetworkManager before deleting WebPage.
Now that the QWebPage actually is a parent of the QNetworkAccessManager, first setting the page to None and then deleting the QNetworkAccessManager will get us a RuntimeError because the underlying C++ object is already gone.
This commit is contained in:
parent
7813f8f0c2
commit
892c02268a
@ -278,14 +278,12 @@ class WebView(QWebView):
|
||||
settings = self.settings()
|
||||
settings.setAttribute(QWebSettings.JavascriptEnabled, False)
|
||||
self.stop()
|
||||
nam = self.page().networkAccessManager()
|
||||
self.page().networkAccessManager().shutdown()
|
||||
# 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)
|
||||
nam.shutdown()
|
||||
del nam
|
||||
|
||||
def openurl(self, url):
|
||||
"""Open a URL in the browser.
|
||||
|
Loading…
Reference in New Issue
Block a user