mirror of https://github.com/python/cpython
Add close() method that breaks cycles.
This commit is contained in:
parent
374c0dfb10
commit
dd4dda87c1
|
@ -12,6 +12,14 @@ class Percolator:
|
||||||
self.bottom.delete = self.redir.register("delete", self.delete)
|
self.bottom.delete = self.redir.register("delete", self.delete)
|
||||||
self.filters = []
|
self.filters = []
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
while self.top is not self.bottom:
|
||||||
|
self.removefilter(self.top)
|
||||||
|
self.top = None
|
||||||
|
self.bottom.setdelegate(None); self.bottom = None
|
||||||
|
self.redir.close(); self.redir = None
|
||||||
|
self.text = None
|
||||||
|
|
||||||
def insert(self, index, chars, tags=None):
|
def insert(self, index, chars, tags=None):
|
||||||
# Could go away if inheriting from Delegator
|
# Could go away if inheriting from Delegator
|
||||||
self.top.insert(index, chars, tags)
|
self.top.insert(index, chars, tags)
|
||||||
|
|
Loading…
Reference in New Issue