Handle repeated commandline parsing properly

The control-center may call g_option_context_parse repeatedly,
so we need to reset the static variables used to hold the parsing
results, otherwise things like the search string may leak from
a previous parsing run.
https://bugzilla.gnome.org/show_bug.cgi?id=700362
This commit is contained in:
Matthias Clasen 2013-05-17 21:34:50 -04:00
parent 5c4872d77c
commit beea258891

View file

@ -146,6 +146,15 @@ cc_application_command_line (GApplication *application,
cc_panel_loader_add_option_groups (context, flags_builder);
g_option_context_set_help_enabled (context, FALSE);
start_panels = NULL;
search_str = NULL;
show_overview = FALSE;
verbose = FALSE;
show_help = FALSE;
show_help_gtk = FALSE;
show_help_all = FALSE;
list_panels = FALSE;
if (g_option_context_parse (context, &argc, &argv, &error) == FALSE)
{
g_print (_("%s\nRun '%s --help' to see a full list of available command line options.\n"),