summaryrefslogtreecommitdiffstats
path: root/module/network/HTTPDownload.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/network/HTTPDownload.py')
-rw-r--r--module/network/HTTPDownload.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py
index 8bc2c7645..5f3302ce2 100644
--- a/module/network/HTTPDownload.py
+++ b/module/network/HTTPDownload.py
@@ -97,6 +97,9 @@ class HTTPDownload():
fo.write(data)
fi.close()
if fo.tell() < self.info.getChunkRange(i)[1]:
+ fo.close()
+ remove(init)
+ self.info.remove() #there are probably invalid chunks
raise Exception("Downloaded content was smaller than expected")
remove(fname) #remove chunk
fo.close()
@@ -230,8 +233,10 @@ class HTTPDownload():
chunk.close()
self.m.remove_handle(chunk.c)
- self.m.close()
self.chunks = []
+ if hasattr(self, "m"):
+ self.m.close()
+ del self.m
if hasattr(self, "cj"):
del self.cj
if hasattr(self, "info"):