fix: try close mmap (#12306)

This commit is contained in:
wozeparrot
2025-09-25 20:54:27 -07:00
committed by GitHub
parent 17cec8d645
commit d2cd269e28

View File

@@ -41,7 +41,9 @@ class DiskDevice(Compiled):
if self.count == 0:
if self.fd is not None:
os.close(self.fd)
if hasattr(self, "mem"): self.mem.close()
if hasattr(self, "mem"):
try: self.mem.close()
except BufferError: pass
self.size = None
def _iouring_setup(self):
DiskDevice._tried_io_uring_init = True