[evolution-ews] Fix few memory leaks around gtk_tree_view_new_with_model()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Fix few memory leaks around gtk_tree_view_new_with_model()
- Date: Wed, 4 Jul 2018 12:11:36 +0000 (UTC)
commit 124520394ab9e2e7b15ca7cd798e097665dde1cc
Author: Milan Crha <mcrha redhat com>
Date: Wed Jul 4 14:10:40 2018 +0200
Fix few memory leaks around gtk_tree_view_new_with_model()
src/configuration/e-ews-edit-folder-permissions.c | 6 ++++--
src/configuration/e-ews-search-user.c | 6 ++++--
src/configuration/e-mail-config-ews-delegates-page.c | 6 ++++--
3 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/src/configuration/e-ews-edit-folder-permissions.c
b/src/configuration/e-ews-edit-folder-permissions.c
index 64c87361..86e2b625 100644
--- a/src/configuration/e-ews-edit-folder-permissions.c
+++ b/src/configuration/e-ews-edit-folder-permissions.c
@@ -854,6 +854,7 @@ create_permissions_tree_view (GObject *dialog,
struct EEwsPermissionsDialogWidgets *widgets)
{
GtkTreeView *tree_view;
+ GtkTreeModel *model;
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
@@ -861,8 +862,9 @@ create_permissions_tree_view (GObject *dialog,
g_return_val_if_fail (widgets != NULL, NULL);
- tree_view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (
- GTK_TREE_MODEL (gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER,
G_TYPE_UINT, G_TYPE_BOOLEAN))));
+ model = GTK_TREE_MODEL (gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER,
G_TYPE_UINT, G_TYPE_BOOLEAN));
+ tree_view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (model));
+ g_object_unref (model);
renderer = gtk_cell_renderer_text_new ();
g_object_set (renderer, "editable", FALSE, NULL);
diff --git a/src/configuration/e-ews-search-user.c b/src/configuration/e-ews-search-user.c
index 46195988..4c20fb89 100644
--- a/src/configuration/e-ews-search-user.c
+++ b/src/configuration/e-ews-search-user.c
@@ -413,6 +413,7 @@ create_users_tree_view (GtkWidget *dialog,
struct EEwsSearchUserData *pgu)
{
GtkTreeView *tree_view;
+ GtkTreeModel *model;
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
@@ -421,8 +422,9 @@ create_users_tree_view (GtkWidget *dialog,
g_return_val_if_fail (dialog != NULL, NULL);
g_return_val_if_fail (pgu != NULL, NULL);
- tree_view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (
- GTK_TREE_MODEL (gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_POINTER, G_TYPE_UINT))));
+ model = GTK_TREE_MODEL (gtk_list_store_new (5, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_POINTER, G_TYPE_UINT));
+ tree_view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (model));
+ g_object_unref (model);
renderer = gtk_cell_renderer_text_new ();
g_object_set (renderer, "editable", FALSE, NULL);
diff --git a/src/configuration/e-mail-config-ews-delegates-page.c
b/src/configuration/e-mail-config-ews-delegates-page.c
index 1a127d13..b802e062 100644
--- a/src/configuration/e-mail-config-ews-delegates-page.c
+++ b/src/configuration/e-mail-config-ews-delegates-page.c
@@ -977,6 +977,7 @@ static GtkWidget *
create_users_tree_view (EMailConfigEwsDelegatesPage *page)
{
GtkTreeView *tree_view;
+ GtkTreeModel *model;
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
@@ -984,8 +985,9 @@ create_users_tree_view (EMailConfigEwsDelegatesPage *page)
g_return_val_if_fail (page != NULL, NULL);
- tree_view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (
- GTK_TREE_MODEL (gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER))));
+ model = GTK_TREE_MODEL (gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER));
+ tree_view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (model));
+ g_object_unref (model);
gtk_tree_view_set_headers_visible (tree_view, FALSE);
renderer = gtk_cell_renderer_text_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]