Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -659,6 +659,7 @@ build_conversations_view(ConversationsView *self) ...@@ -659,6 +659,7 @@ build_conversations_view(ConversationsView *self)
auto model = create_and_fill_model(self); auto model = create_and_fill_model(self);
gtk_tree_view_set_model(GTK_TREE_VIEW(self), gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model)); GTK_TREE_MODEL(model));
g_object_unref(model);
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(self), false); gtk_tree_view_set_enable_search(GTK_TREE_VIEW(self), false);
...@@ -713,6 +714,7 @@ build_conversations_view(ConversationsView *self) ...@@ -713,6 +714,7 @@ build_conversations_view(ConversationsView *self)
gtk_tree_view_set_model(GTK_TREE_VIEW(self), gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model)); GTK_TREE_MODEL(model));
g_object_unref(model);
}); });
...@@ -724,6 +726,7 @@ build_conversations_view(ConversationsView *self) ...@@ -724,6 +726,7 @@ build_conversations_view(ConversationsView *self)
gtk_tree_view_set_model(GTK_TREE_VIEW(self), gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model)); GTK_TREE_MODEL(model));
g_object_unref(model);
}); });
priv->searchStatusChangedConnection_ = QObject::connect( priv->searchStatusChangedConnection_ = QObject::connect(
&*(*priv->accountInfo_)->conversationModel, &*(*priv->accountInfo_)->conversationModel,
...@@ -783,6 +786,7 @@ build_conversations_view(ConversationsView *self) ...@@ -783,6 +786,7 @@ build_conversations_view(ConversationsView *self)
gtk_tree_view_set_model(GTK_TREE_VIEW(self), gtk_tree_view_set_model(GTK_TREE_VIEW(self),
GTK_TREE_MODEL(model)); GTK_TREE_MODEL(model));
g_object_unref(model);
}); });
priv->callChangedConnection_ = QObject::connect( priv->callChangedConnection_ = QObject::connect(
...@@ -801,6 +805,7 @@ build_conversations_view(ConversationsView *self) ...@@ -801,6 +805,7 @@ build_conversations_view(ConversationsView *self)
// create updated model // create updated model
auto new_model = create_and_fill_model(self); auto new_model = create_and_fill_model(self);
gtk_tree_view_set_model(GTK_TREE_VIEW(self), GTK_TREE_MODEL(new_model)); gtk_tree_view_set_model(GTK_TREE_VIEW(self), GTK_TREE_MODEL(new_model));
g_object_unref(new_model);
// make sure conversation remains selected // make sure conversation remains selected
conversations_view_select_conversation(self, conversationUid); conversations_view_select_conversation(self, conversationUid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment