Unverified Commit 88a1ee24 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

conversationsview: avoid leaking model

gtk_tree_view_set_model doesn't unref model, should be unref.

Change-Id: I862eb4255ed9f0f2e01c7a958eb5e6be3e851cc8
GitLab: #1215
parent b55bd2a6
......@@ -659,6 +659,7 @@ build_conversations_view(ConversationsView *self)
auto model = create_and_fill_model(self);
gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model));
g_object_unref(model);
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(self), false);
......@@ -713,6 +714,7 @@ build_conversations_view(ConversationsView *self)
gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model));
g_object_unref(model);
});
......@@ -724,6 +726,7 @@ build_conversations_view(ConversationsView *self)
gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model));
g_object_unref(model);
});
priv->searchStatusChangedConnection_ = QObject::connect(
&*(*priv->accountInfo_)->conversationModel,
......@@ -783,6 +786,7 @@ build_conversations_view(ConversationsView *self)
gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model));
g_object_unref(model);
});
priv->callChangedConnection_ = QObject::connect(
......@@ -801,6 +805,7 @@ build_conversations_view(ConversationsView *self)
// create updated model
auto new_model = create_and_fill_model(self);
gtk_tree_view_set_model(GTK_TREE_VIEW(self), GTK_TREE_MODEL(new_model));
g_object_unref(new_model);
// make sure conversation remains selected
conversations_view_select_conversation(self, conversationUid);
......
Supports Markdown
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