[epiphany/wip/bookmarks: 36/76] bookmarks-popover: Free allocated memory
- From: Iulian Radu <iulianradu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/bookmarks: 36/76] bookmarks-popover: Free allocated memory
- Date: Wed, 28 Sep 2016 13:19:49 +0000 (UTC)
commit 785132c80bd5175e23d48b0909fa687dc4890a6b
Author: Iulian Radu <iulian radu67 gmail com>
Date: Tue Aug 16 11:45:24 2016 +0300
bookmarks-popover: Free allocated memory
src/ephy-bookmarks-popover.c | 34 ++++++++++++++++++++++------------
1 files changed, 22 insertions(+), 12 deletions(-)
---
diff --git a/src/ephy-bookmarks-popover.c b/src/ephy-bookmarks-popover.c
index c36c66e..ce63bbd 100644
--- a/src/ephy-bookmarks-popover.c
+++ b/src/ephy-bookmarks-popover.c
@@ -137,16 +137,22 @@ create_bookmark_row (gpointer item,
GtkWidget *row;
row = ephy_bookmark_row_new (bookmark);
- g_object_set_data (G_OBJECT (row), "type", g_strdup (EPHY_LIST_BOX_ROW_TYPE_BOOKMARK));
- g_object_set_data (G_OBJECT (row), "title", g_strdup (ephy_bookmark_get_title (bookmark)));
- g_object_set_data (G_OBJECT (row), "url", g_strdup (ephy_bookmark_get_url (bookmark)));
-
- g_signal_connect (bookmark, "tag-added",
- G_CALLBACK (bookmark_tag_added_cb),
- user_data);
- g_signal_connect (bookmark, "tag-removed",
- G_CALLBACK (bookmark_tag_removed_cb),
- user_data);
+ g_object_set_data_full (G_OBJECT (row), "type",
+ g_strdup (EPHY_LIST_BOX_ROW_TYPE_BOOKMARK),
+ (GDestroyNotify)g_free);
+ g_object_set_data_full (G_OBJECT (row), "title",
+ g_strdup (ephy_bookmark_get_title (bookmark)),
+ (GDestroyNotify)g_free);
+ g_object_set_data_full (G_OBJECT (row), "url",
+ g_strdup (ephy_bookmark_get_url (bookmark)),
+ (GDestroyNotify)g_free);
+
+ g_signal_connect_object (bookmark, "tag-added",
+ G_CALLBACK (bookmark_tag_added_cb),
+ user_data, 0);
+ g_signal_connect_object (bookmark, "tag-removed",
+ G_CALLBACK (bookmark_tag_removed_cb),
+ user_data, 0);
return row;
}
@@ -160,8 +166,12 @@ create_tag_row (const char *tag)
GtkWidget *label;
row = gtk_list_box_row_new ();
- g_object_set_data (G_OBJECT (row), "type", g_strdup (EPHY_LIST_BOX_ROW_TYPE_TAG));
- g_object_set_data (G_OBJECT (row), "title", g_strdup (tag));
+ g_object_set_data_full (G_OBJECT (row), "type",
+ g_strdup (EPHY_LIST_BOX_ROW_TYPE_TAG),
+ (GDestroyNotify)g_free);
+ g_object_set_data_full (G_OBJECT (row), "title",
+ g_strdup (tag),
+ (GDestroyNotify)g_free);
g_object_set (G_OBJECT (row), "height-request", 40, NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]