Fix: possible memory leaks close #5277 (#5500)

### What problem does this PR solve?

close #5277 by make sure the file close

### Type of change

- [x] Performance Improvement

---------

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
yihong
2025-03-03 10:26:45 +08:00
committed by GitHub
parent d6836444c9
commit 8a2542157f
4 changed files with 9 additions and 1 deletions

View File

@ -188,6 +188,7 @@ def thumbnail_img(filename, blob):
buffered = BytesIO()
else:
break
pdf.close()
return img
elif re.match(r".*\.(jpg|jpeg|png|tif|gif|icon|ico|webp)$", filename):