mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 08:10:08 +01:00
2007-06-05 Christopher Aillon <caillon@redhat.com>
Patch from Christian Persch <chpe@gnome.org> * auth-dialog/main.c: * auth-dialog-general/main.c: Stop leaking GnomeProgram objects. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2576 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
efa2d83d59
commit
edc00728ab
3 changed files with 26 additions and 16 deletions
|
|
@ -1,3 +1,11 @@
|
|||
2007-06-05 Christopher Aillon <caillon@redhat.com>
|
||||
|
||||
Patch from Christian Persch <chpe@gnome.org>
|
||||
|
||||
* auth-dialog/main.c:
|
||||
* auth-dialog-general/main.c:
|
||||
Stop leaking GnomeProgram objects.
|
||||
|
||||
2007-02-02 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-ppp-starter.c
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ main (int argc, char *argv[])
|
|||
static gchar *service_name = NULL;
|
||||
GError *error = NULL;
|
||||
GOptionContext *context;
|
||||
static GOptionEntry entries[] =
|
||||
GnomeProgram *program;
|
||||
GOptionEntry entries[] =
|
||||
{
|
||||
{ "reprompt", 'r', 0, G_OPTION_ARG_NONE, &retry, "Reprompt for passwords", NULL},
|
||||
{ "name", 'n', 0, G_OPTION_ARG_STRING, &connection_name, "Name of connection", NULL},
|
||||
|
|
@ -125,9 +126,13 @@ main (int argc, char *argv[])
|
|||
|
||||
context = g_option_context_new ("- ppp auth dialog");
|
||||
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
||||
g_option_context_add_group (context, gtk_get_option_group (TRUE));
|
||||
g_option_context_parse (context, &argc, &argv, &error);
|
||||
|
||||
program = gnome_program_init ("nm-ppp-auth-dialog", VERSION,
|
||||
LIBGNOMEUI_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PARAM_GOPTION_CONTEXT, context,
|
||||
GNOME_PARAM_NONE);
|
||||
|
||||
if (connection_name == NULL || service_name == NULL) {
|
||||
fprintf (stderr, "Have to supply both name and service\n");
|
||||
goto out;
|
||||
|
|
@ -138,10 +143,6 @@ main (int argc, char *argv[])
|
|||
goto out;
|
||||
}
|
||||
|
||||
gnome_program_init ("nm-ppp-auth-dialog", VERSION, LIBGNOMEUI_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PARAM_NONE);
|
||||
|
||||
passwords = get_passwords (connection_name, service_name, retry);
|
||||
if (passwords == NULL)
|
||||
goto out;
|
||||
|
|
@ -162,7 +163,7 @@ main (int argc, char *argv[])
|
|||
fread (buf, sizeof (char), sizeof (buf), stdin);
|
||||
|
||||
out:
|
||||
g_option_context_free (context);
|
||||
g_object_unref (program);
|
||||
|
||||
return passwords != NULL ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -214,7 +214,8 @@ main (int argc, char *argv[])
|
|||
static gchar *vpn_service = NULL;
|
||||
GError *error = NULL;
|
||||
GOptionContext *context;
|
||||
static GOptionEntry entries[] =
|
||||
GnomeProgram *program;
|
||||
GOptionEntry entries[] =
|
||||
{
|
||||
{ "reprompt", 'r', 0, G_OPTION_ARG_NONE, &retry, "Reprompt for passwords", NULL},
|
||||
{ "name", 'n', 0, G_OPTION_ARG_STRING, &vpn_name, "Name of VPN connection", NULL},
|
||||
|
|
@ -231,9 +232,13 @@ main (int argc, char *argv[])
|
|||
|
||||
context = g_option_context_new ("- ppp auth dialog");
|
||||
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
||||
g_option_context_add_group (context, gtk_get_option_group (TRUE));
|
||||
g_option_context_parse (context, &argc, &argv, &error);
|
||||
|
||||
program = gnome_program_init ("nm-ppp-auth-dialog", VERSION,
|
||||
LIBGNOMEUI_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PARAM_GOPTION_CONTEXT, context,
|
||||
GNOME_PARAM_NONE);
|
||||
|
||||
if (vpn_name == NULL || vpn_service == NULL) {
|
||||
fprintf (stderr, "Have to supply both name and service\n");
|
||||
goto out;
|
||||
|
|
@ -244,10 +249,6 @@ main (int argc, char *argv[])
|
|||
goto out;
|
||||
}
|
||||
|
||||
gnome_program_init ("nm-ppp-auth-dialog", VERSION, LIBGNOMEUI_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PARAM_NONE);
|
||||
|
||||
passwords = get_passwords (vpn_name, vpn_service, retry);
|
||||
if (passwords == NULL)
|
||||
goto out;
|
||||
|
|
@ -268,7 +269,7 @@ main (int argc, char *argv[])
|
|||
fread (buf, sizeof (char), sizeof (buf), stdin);
|
||||
|
||||
out:
|
||||
g_option_context_free (context);
|
||||
g_object_unref (program);
|
||||
|
||||
return passwords != NULL ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue