소스 검색

Fix leak when pack cache is rebuilt.

Damien Tournoud 11 년 전
부모
커밋
d10a3a0a4a
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      dulwich/object_store.py

+ 4 - 1
dulwich/object_store.py

@@ -303,7 +303,10 @@ class PackBasedObjectStore(BaseObjectStore):
     @property
     def packs(self):
         """List with pack objects."""
-        if self._pack_cache is None or self._pack_cache_stale():
+        if self._pack_cache is not None and self._pack_cache_stale():
+            self.close()
+
+        if self._pack_cache is None:
             self._pack_cache = self._load_packs()
         return self._pack_cache