summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lulua/text.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lulua/text.py b/lulua/text.py
index 18e4dbf..ea91139 100644
--- a/lulua/text.py
+++ b/lulua/text.py
@@ -193,6 +193,10 @@ def filterEpub (item):
stream = walker (document)
s = HTMLSerializer()
yield ''.join (s.serialize (stream))
+ # It looks like ebooklib is leaking ZipFile instances somewhere, which
+ # can be prevented by resetting the book before the GC grabs it.
+ book.reset ()
+ del book
def filterText (fd):
yield fd.read ().decode ('utf-8')