diff options
author | Patrick Griffis <tingping@tingping.se> | 2016-07-24 21:10:34 -0400 |
---|---|---|
committer | Patrick Griffis <tingping@tingping.se> | 2016-07-24 21:10:34 -0400 |
commit | ac986bb3a47931b765b23560338e130d21c78abf (patch) | |
tree | 6a951b25bd0a0f84e691a099ea59f8bb241ebf0c /src/fe-gtk | |
parent | 03767ee0f98262220eb13a2fcb1f2fe0963cba3d (diff) |
Fix leak
Diffstat (limited to 'src/fe-gtk')
-rw-r--r-- | src/fe-gtk/maingui.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 6ab322bc..9c283166 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -1332,9 +1332,6 @@ mg_chan_remove (chan *ch) static void mg_close_gen (chan *ch, GtkWidget *box) { - char *title = g_object_get_data (G_OBJECT (box), "title"); - - g_free (title); if (!ch) ch = g_object_get_data (G_OBJECT (box), "ch"); if (ch) @@ -3339,8 +3336,8 @@ mg_add_generic_tab (char *name, char *title, void *family, GtkWidget *box) ch = chanview_add (mg_gui->chanview, name, NULL, box, TRUE, TAG_UTIL, pix_tree_util); chan_set_color (ch, plain_list); - /* FIXME: memory leak */ - g_object_set_data (G_OBJECT (box), "title", g_strdup (title)); + + g_object_set_data_full (G_OBJECT (box), "title", g_strdup (title), g_free); g_object_set_data (G_OBJECT (box), "ch", ch); if (prefs.hex_gui_tab_newtofront) @@ -3630,8 +3627,7 @@ mg_set_title (GtkWidget *vbox, char *title) /* for non-irc tab/window only */ old = g_object_get_data (G_OBJECT (vbox), "title"); if (old) { - g_object_set_data (G_OBJECT (vbox), "title", g_strdup (title)); - g_free (old); + g_object_set_data_full (G_OBJECT (vbox), "title", g_strdup (title), g_free); } else { gtk_window_set_title (GTK_WINDOW (vbox), title); |