Summary: | toolbar leaks memory on changing property list | ||
---|---|---|---|
Product: | UIM | Reporter: | Yusuke TABATA <yusuke> |
Component: | helper: toolbar | Assignee: | uim-bugs |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | high | CC: | uim-bugs |
Version: | unspecified | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Yusuke TABATA
2004-05-05 19:07:34 UTC
Following diff diminishes most of leak. However, there still some leaks remains. --- helper-toolbar-common-gtk.c (revision 792) +++ helper-toolbar-common-gtk.c (working copy) @@ -88,7 +88,7 @@ static void helper_applet_prop_list_update(gchar **tmp) { - GtkMenuShell *prop_menu = NULL; /* quiet gcc */ + static GtkMenuShell *prop_menu = NULL; /* quiet gcc */ GtkWidget *button; int i = 0; gchar **tmp2 = NULL; @@ -137,6 +137,10 @@ button = gtk_button_new_with_label(tmp2[1]); gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); menu_buttons = g_list_append(menu_buttons, button); + + if (prop_menu) { + gtk_widget_destroy(prop_menu); + } prop_menu = (GtkMenuShell*)gtk_menu_new(); Here's another leak -- GtkWidget *menu_item = gtk_menu_item_new_with_label(tmp2[2]); - g_object_set_data(G_OBJECT(menu_item), "prop_name", g_strdup(tmp2[4])); + g_object_set_data_full(G_OBJECT(menu_item), "prop_name", g_strdup(tmp2[4]), g_free); gtk_menu_shell_append(prop_menu, menu_item); Diff in comment #2 is obvious. So I commited it. Please audit #1 and investigate other leaks. menu_item is possible culprit. First patch is not enough to fix all of memory leaks, because prop_menu may be used more than one times. I committed fix of leaking by another way, please test rev 814. I confirmed. This problem seems to have fixed. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.