From ac99467965ba04282b6dbc63c5c04ab91ba1b007 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 13 Feb 2011 22:28:35 +0100 Subject: Make the tab collectable by remove self references when closing them. --- src/text_buffer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/text_buffer.py') 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))) -- cgit v1.2.3