summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-03-07 21:41:13 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-03-07 21:41:13 +0100
commit8f48c5ede7e1da18f85daae9bda5a4b68272498b (patch)
tree2ccbe6a10613ee0e5301e81fde396fd04fccf543 /src/tabs.py
parenta769babf0acd03bf9c22a5f03808dab7b0c52cc4 (diff)
downloadpoezio-8f48c5ede7e1da18f85daae9bda5a4b68272498b.tar.gz
poezio-8f48c5ede7e1da18f85daae9bda5a4b68272498b.tar.bz2
poezio-8f48c5ede7e1da18f85daae9bda5a4b68272498b.tar.xz
poezio-8f48c5ede7e1da18f85daae9bda5a4b68272498b.zip
Inputs are garbage collected, making MucListTab collectable.
Memory improvement issues.
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 6788a49d..cd13273a 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -61,6 +61,7 @@ class Tab(object):
number = 0
tab_core = None
def __init__(self):
+ self.input = None
self._color_state = theme.COLOR_TAB_NORMAL
self.need_resize = False
self.nb = Tab.number
@@ -226,10 +227,10 @@ class Tab(object):
"""
Called when the tab is to be closed
"""
- pass
+ self.input.on_delete()
def __del__(self):
- log.debug('Closing tab %s' % self.__class__.__name__)
+ log.debug('------ Closing tab %s' % self.__class__.__name__)
class ChatTab(Tab):
"""
@@ -384,9 +385,6 @@ class InfoTab(ChatTab, TabWithInfoWin):
def just_before_refresh(self):
return
- def on_close(self):
- return
-
class MucTab(ChatTab, TabWithInfoWin):
"""
The tab containing a multi-user-chat room.
@@ -726,9 +724,6 @@ class MucTab(ChatTab, TabWithInfoWin):
def just_before_refresh(self):
return
- def on_close(self):
- return
-
def handle_presence(self, presence):
from_nick = presence['from'].resource
from_room = presence['from'].bare
@@ -1036,9 +1031,6 @@ class PrivateTab(ChatTab, TabWithInfoWin):
def just_before_refresh(self):
return
- def on_close(self):
- return
-
def rename_user(self, old_nick, new_nick):
"""
The user changed her nick in the corresponding muc: update the tab’s name and
@@ -1474,6 +1466,7 @@ class ConversationTab(ChatTab, TabWithInfoWin):
return
def on_close(self):
+ Tab.on_close(self)
if config.get('send_chat_states', 'true') == 'true':
self.send_chat_state('gone')
@@ -1541,6 +1534,7 @@ class MucListTab(Tab):
self.input.do_command("/") # we add the slash
def close(self, arg=None):
+ self.input.on_delete()
self.core.close_tab(self)
def join_selected_no_focus(self):