##// END OF EJS Templates
repoview: fix memory leak of filtered repo classes...
Georges Racinet -
r47775:76ae43d5 stable
parent child Browse files
Show More
@@ -472,12 +472,15 b' class repoview(object):'
472
472
473 def newtype(base):
473 def newtype(base):
474 """Create a new type with the repoview mixin and the given base class"""
474 """Create a new type with the repoview mixin and the given base class"""
475 cls = _filteredrepotypes.get(base)
475 ref = _filteredrepotypes.get(base)
476 if cls is not None:
476 if ref is not None:
477 return cls
477 cls = ref()
478 if cls is not None:
479 return cls
478
480
479 class filteredrepo(repoview, base):
481 class filteredrepo(repoview, base):
480 pass
482 pass
481
483
482 _filteredrepotypes[base] = filteredrepo
484 _filteredrepotypes[base] = weakref.ref(filteredrepo)
485 # do not reread from weakref to be 100% sure not to return None
483 return filteredrepo
486 return filteredrepo
General Comments 0
You need to be logged in to leave comments. Login now