From beea258891ac433e754461ce48d1283c0e3194b5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 17 May 2013 21:34:50 -0400 Subject: [PATCH] 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 --- shell/cc-application.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell/cc-application.c b/shell/cc-application.c index e7de6f753..7a21086d6 100644 --- a/shell/cc-application.c +++ b/shell/cc-application.c @@ -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"),