Commit 19b181b7 authored by Mohammed Sadiq's avatar Mohammed Sadiq
Browse files

chat-view: Clear related hash table data on finalize

Do it in chat-view instead of manager, so that we can avoid
a public API
parent ed7e5488
......@@ -890,6 +890,9 @@ chatty_chat_view_finalize (GObject *object)
{
ChattyChatView *self = (ChattyChatView *)object;
g_hash_table_foreach_remove (ht_sms_id,
chat_view_hash_table_match_item,
self);
g_clear_object (&self->chat);
G_OBJECT_CLASS (chatty_chat_view_parent_class)->finalize (object);
......@@ -1025,14 +1028,3 @@ chatty_chat_view_get_chat (ChattyChatView *self)
return self->chat;
}
void
chatty_chat_view_remove_footer (ChattyChatView *self)
{
g_return_if_fail (CHATTY_IS_CHAT_VIEW (self));
g_hash_table_foreach_remove (ht_sms_id,
chat_view_hash_table_match_item,
self);
}
......@@ -45,6 +45,5 @@ void chatty_chat_view_set_chat (ChattyChatView *self,
ChattyChat *chatty_chat_view_get_chat (ChattyChatView *self);
void chatty_chat_view_load (ChattyChatView *self,
guint limit);
void chatty_chat_view_remove_footer (ChattyChatView *self);
G_END_DECLS
......@@ -2413,7 +2413,6 @@ chatty_manager_delete_conversation (ChattyManager *self,
}
if (chat) {
chatty_chat_view_remove_footer (CHATTY_CHAT_VIEW (CHATTY_CONVERSATION (conv)->chat_view));
chatty_utils_remove_list_item (G_LIST_STORE (model), chat);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment