Delete QWebEngineDownloadItem objects when wrapper object is deleted

This commit is contained in:
Jay Kamat 2018-02-04 02:11:34 -05:00
parent 79935e048c
commit 0ebde6f2e9
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -45,6 +45,10 @@ class DownloadItem(downloads.AbstractDownloadItem):
qt_item.downloadProgress.connect(self.stats.on_download_progress) qt_item.downloadProgress.connect(self.stats.on_download_progress)
qt_item.stateChanged.connect(self._on_state_changed) qt_item.stateChanged.connect(self._on_state_changed)
# Ensure wrapped qt_item is deleted manually when the wrapper object
# is deleted. See https://github.com/qutebrowser/qutebrowser/issues/3373
self.destroyed.connect(self._qt_item.deleteLater)
def _is_page_download(self): def _is_page_download(self):
"""Check if this item is a page (i.e. mhtml) download.""" """Check if this item is a page (i.e. mhtml) download."""
return (self._qt_item.savePageFormat() != return (self._qt_item.savePageFormat() !=