Permalink
Browse files

Remove request tracking from NetworkManager

This breaks things (with "ValueError: list.remove(x): x not in list") on
PyQt 5.9 (probably due to the destroyed object tracking it introduces?).

This was originally added in 0abb5cf to fix
some segfaults on exit, but things look much better with recent Qt versions.
  • Loading branch information...
The-Compiler committed Jun 5, 2017
1 parent 211f9cf commit a45de9cef2f8c292d42aa4f63bf6a1ea08557508
Showing with 0 additions and 10 deletions.
  1. +0 −10 qutebrowser/browser/webkit/network/networkmanager.py
@@ -121,7 +121,6 @@ class NetworkManager(QNetworkAccessManager):
reparented to the DownloadManager. This counts the
still running downloads, so the QNAM can clean
itself up when this reaches zero again.
_requests: Pending requests.
_scheme_handlers: A dictionary (scheme -> handler) of supported custom
schemes.
_win_id: The window ID this NetworkManager is associated with.
@@ -146,7 +145,6 @@ def __init__(self, *, win_id, tab_id, private, parent=None):
self.adopted_downloads = 0
self._win_id = win_id
self._tab_id = tab_id
self._requests = []
self._private = private
self._scheme_handlers = {
'qute': webkitqutescheme.QuteSchemeHandler(win_id),
@@ -201,9 +199,6 @@ def _get_abort_signals(self, owner=None):
def shutdown(self):
"""Abort all running requests."""
self.setNetworkAccessible(QNetworkAccessManager.NotAccessible)
for request in self._requests:
request.abort()
request.deleteLater()
self.shutting_down.emit()
# No @pyqtSlot here, see
@@ -370,9 +365,6 @@ def set_referer(self, req, current_url):
def createRequest(self, op, req, outgoing_data):
"""Return a new QNetworkReply object.
Extend QNetworkAccessManager::createRequest to save requests in
self._requests and handle custom schemes.
Args:
op: Operation op
req: const QNetworkRequest & req
@@ -437,6 +429,4 @@ def createRequest(self, op, req, outgoing_data):
reply = super().createRequest(op, req, outgoing_data)
else:
reply = super().createRequest(op, req, outgoing_data)
self._requests.append(reply)
reply.destroyed.connect(self._requests.remove)
return reply

0 comments on commit a45de9c

Please sign in to comment.