Commit 4ab011ca authored by Scott Reeves's avatar Scott Reeves

don't leak the GList

svn path=/trunk/; revision=124
parent 73438977
......@@ -39,7 +39,7 @@ After installing a "Gnome Main Menu" applet should appear in your "Add to panel
Contributing
------------
This project can be found in gnome-cvs under the module named "slab". To
This project can be found in gnome svn under the module named "gnome-main-menu". To
access this see: http://developer.gnome.org/tools/cvs.html. Feel free to send
any patches to anyone in the MAINTAINERS file.
......
......@@ -51,6 +51,7 @@ static GSList *get_actions_list ();
static GSList *
get_actions_list ()
{
GSList *l;
GSList *key_list;
GSList *actions_list = NULL;
AppAction *action;
......@@ -62,12 +63,13 @@ get_actions_list ()
return NULL;
}
for (; key_list; key_list = key_list->next)
for (l = key_list; l != NULL; l = l->next)
{
gchar *entry = (gchar *) key_list->data;
gchar *entry = (gchar *) l->data;
gchar **temp;
action = g_new (AppAction, 1);
gchar **temp = g_strsplit (entry, CONTROL_CENTER_ACTIONS_SEPARATOR, 2);
temp = g_strsplit (entry, CONTROL_CENTER_ACTIONS_SEPARATOR, 2);
action->name = g_strdup (temp[0]);
if ((action->item = load_desktop_item_from_unknown (temp[1])) == NULL)
{
......@@ -75,14 +77,15 @@ get_actions_list ()
}
else
{
actions_list = g_slist_append (actions_list, action);
actions_list = g_slist_prepend (actions_list, action);
}
g_strfreev (temp);
g_free (entry);
}
g_slist_free (key_list);
return actions_list;
return g_slist_reverse (actions_list);
}
void
......@@ -112,6 +115,9 @@ main (int argc, char *argv[])
BonoboApplication *bonobo_app = NULL;
gboolean hidden = FALSE;
gchar * startup_id;
AppShellData *app_data;
GSList *actions;
GnomeProgram *program;
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
......@@ -132,7 +138,7 @@ main (int argc, char *argv[])
}
startup_id = g_strdup (g_getenv (DESKTOP_STARTUP_ID));
gnome_program_init ("Gnome Control Center", "0.1", LIBGNOMEUI_MODULE,
program = gnome_program_init ("GNOME Control Center", "0.1", LIBGNOMEUI_MODULE,
argc, argv, NULL, NULL);
if (apss_already_running (argc, argv, &bonobo_app, "GNOME-NLD-ControlCenter", startup_id))
......@@ -143,11 +149,11 @@ main (int argc, char *argv[])
exit (1);
}
AppShellData *app_data = appshelldata_new (
app_data = appshelldata_new (
"preferences.menu", NULL, CONTROL_CENTER_PREFIX, GTK_ICON_SIZE_DIALOG, TRUE);
generate_categories (app_data);
GSList *actions = get_actions_list ();
actions = get_actions_list ();
layout_shell (app_data, _("Filter"), _("Groups"), _("Common Tasks"), actions,
handle_static_action_clicked);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment