]> arthur.barton.de Git - bup.git/commitdiff
lib/bup/index.py: mmap.mmap() objects need to be closed() for Win32.
authorLukasz Kosewski <lkosewsk@gmail.com>
Mon, 15 Mar 2010 03:17:42 +0000 (23:17 -0400)
committerLukasz Kosewski <lkosewsk@gmail.com>
Mon, 15 Mar 2010 20:15:44 +0000 (16:15 -0400)
Not *entirely* sure why this is the case, but it appears through some
refcounting weirdness, just setting the mmap variables to None in
index.Readers doesn't cause the mmap to be freed under Cygwin, though
I can't find any reason why this would be the case.

Naturally, this caused all sort of pain when we attempt to unlink
an mmaped file created while running bup index --check -u.

Fix the issue by explicitly .close()ing the mmap in Reader.close().

lib/bup/index.py

index 8aea5c4258f8175e41b416dc0854d57fa4d2cc7a..1c555d7f38929d4405e2178fc5a82805888e83a0 100644 (file)
@@ -293,6 +293,7 @@ class Reader:
     def close(self):
         self.save()
         if self.writable and self.m:
+            self.m.close()
             self.m = None
             self.writable = False