diff options
author | Guido van Rossum <guido@python.org> | 1999-06-25 16:04:38 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-06-25 16:04:38 (GMT) |
commit | dd4dda87c1b80e709417664487dfa7ab5581f4e6 (patch) | |
tree | 18d82fa7343d01e94887cbf91f9583eaba4c808b | |
parent | 374c0dfb10ec9bebffbcc9ec30b37043fd13d6dc (diff) | |
download | cpython-dd4dda87c1b80e709417664487dfa7ab5581f4e6.zip cpython-dd4dda87c1b80e709417664487dfa7ab5581f4e6.tar.gz cpython-dd4dda87c1b80e709417664487dfa7ab5581f4e6.tar.bz2 |
Add close() method that breaks cycles.
-rw-r--r-- | Tools/idle/Percolator.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Tools/idle/Percolator.py b/Tools/idle/Percolator.py index a5f503f..9def5f4 100644 --- a/Tools/idle/Percolator.py +++ b/Tools/idle/Percolator.py @@ -12,6 +12,14 @@ class Percolator: self.bottom.delete = self.redir.register("delete", self.delete) 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): # Could go away if inheriting from Delegator self.top.insert(index, chars, tags) |