downloads: Check if reply is open when doing delayed write.
This fixes a "QIODevice::read: device not open" warning when closing the window while a download is active.
This commit is contained in:
parent
b502280c06
commit
b70c3754e8
@ -266,7 +266,8 @@ class DownloadItem(QObject):
|
||||
"""Write buffered data to disk and finish the QNetworkReply."""
|
||||
log.downloads.debug("Doing delayed write...")
|
||||
self._do_delayed_write = False
|
||||
self._fileobj.write(self._reply.readAll())
|
||||
if self._reply.isOpen():
|
||||
self._fileobj.write(self._reply.readAll())
|
||||
self._fileobj.close()
|
||||
self._reply.close()
|
||||
self._reply.deleteLater()
|
||||
|
Loading…
Reference in New Issue
Block a user