Get Books: Fix error when using internal browser

Get Books: Fix error when using internal browser on some systems. I
cannot replicate this error so my fix is speculative, based on the idea
that not keeping explicit references to the python object is causing
them to be garbage collected. Fixes #1191199 [Python exception downloading books from Barnes & Noble](https://bugs.launchpad.net/calibre/+bug/1191199)
This commit is contained in:
Kovid Goyal 2013-06-16 09:49:50 +05:30
parent b63e0df73f
commit 1bada2b35b

View File

@ -24,8 +24,10 @@ class NPWebView(QWebView):
self.gui = None
self.tags = ''
self.setPage(NPWebPage())
self.page().networkAccessManager().setCookieJar(QNetworkCookieJar())
self._page = NPWebPage()
self.setPage(self._page)
self.cookie_jar = QNetworkCookieJar()
self.page().networkAccessManager().setCookieJar(self.cookie_jar)
http_proxy = get_proxies().get('http', None)
if http_proxy: