summaryrefslogtreecommitdiff
path: root/src/text_buffer.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-02-13 22:28:35 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-02-13 22:28:35 +0100
commitac99467965ba04282b6dbc63c5c04ab91ba1b007 (patch)
tree306bf55c98f4ad80ca014f47be453f1a67fca38a /src/text_buffer.py
parent6ed087a65c1e7fdc020f11b5247a8feeac7b3517 (diff)
downloadpoezio-ac99467965ba04282b6dbc63c5c04ab91ba1b007.tar.gz
poezio-ac99467965ba04282b6dbc63c5c04ab91ba1b007.tar.bz2
poezio-ac99467965ba04282b6dbc63c5c04ab91ba1b007.tar.xz
poezio-ac99467965ba04282b6dbc63c5c04ab91ba1b007.zip
Make the tab collectable by remove self references when closing
them.
Diffstat (limited to 'src/text_buffer.py')
-rw-r--r--src/text_buffer.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/text_buffer.py b/src/text_buffer.py
index 828b344c..9285a433 100644
--- a/src/text_buffer.py
+++ b/src/text_buffer.py
@@ -36,7 +36,7 @@ class TextBuffer(object):
self.messages = [] # Message objects
self.windows = [] # we keep track of one or more windows
# so we can pass the new messages to them, as they are added, so
- # they (the windows) can built the lines from the new message
+ # they (the windows) can build the lines from the new message
def add_window(self, win):
self.windows.append(win)
@@ -55,3 +55,8 @@ class TextBuffer(object):
if window.pos != 0:
window.scroll_up(nb)
+ def del_window(self, win):
+ self.windows.remove(win)
+
+ def __del__(self):
+ log.debug('** Deleting %s messages from textbuffer' % (len(self.messages)))