fix typing and unloading

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi 2025-07-25 15:13:10 +02:00
parent 3e4093db58
commit bbb735d2de

View File

@ -133,9 +133,11 @@ class MetsGbsPageBackend(PdfPageBackend):
width=self._dpage.dimension.width, height=self._dpage.dimension.height width=self._dpage.dimension.width, height=self._dpage.dimension.height
) )
def unload(self): def unload(self) -> None:
self._ppage = None if hasattr(self, "_im"):
self._dpage = None delattr(self, "_im")
if hasattr(self, "_dpage"):
delattr(self, "_dpage")
class _UseType(str, Enum): class _UseType(str, Enum):
@ -392,6 +394,6 @@ class MetsGbsDocumentBackend(PaginatedDocumentBackend):
def supports_pagination(cls) -> bool: def supports_pagination(cls) -> bool:
return True return True
def unload(self): def unload(self) -> None:
super().unload() super().unload()
self._tar.close() self._tar.close()