diff mercurial/bundlerepo.py @ 13382:d747774ca9da

Make sure bundlerepo doesn't leak temp files (issue2491) Add empty repository.close() and call it in dispatch. Remove bundlerepository.__del__(), merging it into bundlerepository.close(), which overrides repository.close(). http://docs.python.org/reference/datamodel.html says: "It is not guaranteed that __del__() methods are called for objects that still exist when the interpreter exits."
author Adrian Buehlmann <adrian@cadifra.com>
date Sat, 12 Feb 2011 10:58:11 +0100
parents 57d433f632b7
children 7abab875e647
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Fri Feb 11 19:32:49 2011 +0100
+++ b/mercurial/bundlerepo.py	Sat Feb 12 10:58:11 2011 +0100
@@ -251,11 +251,6 @@
         self.bundle.close()
         if self.tempfile is not None:
             os.unlink(self.tempfile)
-
-    def __del__(self):
-        del self.bundle
-        if self.tempfile is not None:
-            os.unlink(self.tempfile)
         if self._tempparent:
             shutil.rmtree(self._tempparent, True)