Delete QWebEngineDownloadItem objects when wrapper object is deleted
This commit is contained in:
parent
79935e048c
commit
0ebde6f2e9
@ -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() !=
|
||||||
|
Loading…
Reference in New Issue
Block a user