diff --git a/src/chat.py b/src/chat.py
index 40c54906c665376ebe729bac3aae0edbc133b6a8..0229e40b53a675172d80934e9114be4fb4bf4a30 100644
--- a/src/chat.py
+++ b/src/chat.py
@@ -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 '''
diff --git a/src/groupchat_window.py b/src/groupchat_window.py
index e093d1fbb953099c0792ce4cf5fbab27a37f9e27..ddd4f043cde8bf7ae83cf4250e03fee54bf6ab95 100644
--- a/src/groupchat_window.py
+++ b/src/groupchat_window.py
@@ -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()
diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py
index e43dfd8cabfd1f373f856050ca84312cd197f40c..0d6c1730a8be2d9c492e3bda6b4fd20eb3711a62 100644
--- a/src/tabbed_chat_window.py
+++ b/src/tabbed_chat_window.py
@@ -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'''