clean some vars when we close (group)chat windows/tabs

This commit is contained in:
Yann Leboulanger 2005-08-03 11:36:00 +00:00
parent 5ffbf2dbc0
commit 8018890427
3 changed files with 22 additions and 24 deletions

View File

@ -319,32 +319,31 @@ class Chat:
gajim.config.set('gc-width', width)
gajim.config.set('gc-height', height)
# FIXME: if we're here the del in 10 lines will not be called!
# maybe mem leak?
self.window.destroy()
return
if self.nb_unread[jid] > 0:
self.nb_unread[jid] = 0
else:
if self.nb_unread[jid] > 0:
self.nb_unread[jid] = 0
if self.plugin.systray_enabled:
self.plugin.systray.remove_jid(jid, self.account)
if self.print_time_timeout_id.has_key(jid):
gobject.source_remove(self.print_time_timeout_id[jid])
del self.print_time_timeout_id[jid]
self.notebook.remove_page(self.notebook.page_num(self.childs[jid]))
if len(self.xmls) == 2:
# one that remains and one that we'll remove, 1 tab remains
self.notebook.set_show_tabs(False)
self.show_title()
if self.plugin.systray_enabled:
self.plugin.systray.remove_jid(jid, self.account)
if self.print_time_timeout_id.has_key(jid):
gobject.source_remove(self.print_time_timeout_id[jid])
del self.print_time_timeout_id[jid]
self.notebook.remove_page(self.notebook.page_num(self.childs[jid]))
if len(self.xmls) == 2:
# one that remains and one that we'll remove, 1 tab remains
self.notebook.set_show_tabs(False)
del self.plugin.windows[self.account][kind][jid]
del self.nb_unread[jid]
del gajim.last_message_time[self.account][jid]
del self.last_time_printout[jid]
del self.xmls[jid]
del self.childs[jid]
del self.tagIn[jid]
del self.tagOut[jid]
del self.tagStatus[jid]
self.show_title()
def bring_scroll_to_end(self, textview, diff_y = 0):
''' scrolls to the end of textview if end is not visible '''

View File

@ -940,13 +940,13 @@ class GroupchatWindow(chat.Chat):
if len(self.xmls) > 0:
gajim.connections[self.account].send_gc_status(self.nicks[room_jid],
room_jid, 'offline', 'offline')
del self.nicks[room_jid]
del gajim.gc_contacts[self.account][room_jid]
del gajim.gc_connected[self.account][room_jid]
del self.list_treeview[room_jid]
del self.subjects[room_jid]
del self.name_labels[room_jid]
del self.hpaneds[room_jid]
del self.nicks[room_jid]
del gajim.gc_contacts[self.account][room_jid]
del gajim.gc_connected[self.account][room_jid]
del self.list_treeview[room_jid]
del self.subjects[room_jid]
del self.name_labels[room_jid]
del self.hpaneds[room_jid]
def got_disconnected(self, room_jid):
model = self.list_treeview[room_jid].get_model()

View File

@ -309,8 +309,7 @@ class TabbedChatWindow(chat.Chat):
self.send_chatstate('gone', jid)
chat.Chat.remove_tab(self, jid, 'chats')
if len(self.xmls) > 0:
del self.contacts[jid]
del self.contacts[jid]
def new_user(self, contact):
'''when new tab is created'''