downloads: close fileobject in DownloadItem._die

Otherwise we will get a unclosed resource warning.
This commit is contained in:
Daniel Schadt 2016-05-06 18:01:45 +02:00
parent dcac832f5e
commit 2918c5cd57

View File

@ -412,6 +412,8 @@ class DownloadItem(QObject):
self.reply = None self.reply = None
self.done = True self.done = True
self.data_changed.emit() self.data_changed.emit()
if self.fileobj is not None:
self.fileobj.close()
def init_reply(self, reply): def init_reply(self, reply):
"""Set a new reply and connect its signals. """Set a new reply and connect its signals.