plug memory leaks (fixes bug #395609)
2007-01-31 Jens Granseuer <jensgr@gmx.net> * gnome-network-preferences.c: (cb_remove_url), (cb_dialog_response), (cb_use_same_proxy_checkbutton_clicked), (main): plug memory leaks (fixes bug #395609) svn path=/trunk/; revision=7217
This commit is contained in:
parent
6c52e0a535
commit
5f9d174f42
2 changed files with 36 additions and 18 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-01-31 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
|
* gnome-network-preferences.c: (cb_remove_url),
|
||||||
|
(cb_dialog_response), (cb_use_same_proxy_checkbutton_clicked),
|
||||||
|
(main): plug memory leaks (fixes bug #395609)
|
||||||
|
|
||||||
2007-01-29 Kjartan Maraas <kmaraas@gnome.org>
|
2007-01-29 Kjartan Maraas <kmaraas@gnome.org>
|
||||||
|
|
||||||
* gnome-network-preferences.c: (create_listmodel):
|
* gnome-network-preferences.c: (create_listmodel):
|
||||||
|
|
|
@ -157,6 +157,7 @@ cb_remove_url (GtkButton *button, gpointer data)
|
||||||
{
|
{
|
||||||
if(strcmp(url, (char *) pointer->data) == 0)
|
if(strcmp(url, (char *) pointer->data) == 0)
|
||||||
{
|
{
|
||||||
|
g_free (pointer->data);
|
||||||
ignore_hosts = g_slist_delete_link(ignore_hosts, pointer);
|
ignore_hosts = g_slist_delete_link(ignore_hosts, pointer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -181,8 +182,10 @@ cb_dialog_response (GtkDialog *dialog, gint response_id)
|
||||||
"goscustdesk-50");
|
"goscustdesk-50");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(ignore_hosts)
|
if (ignore_hosts) {
|
||||||
g_slist_free(ignore_hosts);
|
g_slist_foreach (ignore_hosts, (GFunc) g_free, NULL);
|
||||||
|
g_slist_free (ignore_hosts);
|
||||||
|
}
|
||||||
|
|
||||||
gtk_main_quit ();
|
gtk_main_quit ();
|
||||||
}
|
}
|
||||||
|
@ -262,6 +265,7 @@ cb_use_same_proxy_checkbutton_clicked (GtkWidget *checkbutton,
|
||||||
gboolean same_proxy;
|
gboolean same_proxy;
|
||||||
gchar *http_proxy;
|
gchar *http_proxy;
|
||||||
gint http_port;
|
gint http_port;
|
||||||
|
gchar *host;
|
||||||
|
|
||||||
client = gconf_client_get_default ();
|
client = gconf_client_get_default ();
|
||||||
same_proxy = gconf_client_get_bool (client, USE_SAME_PROXY_KEY, NULL);
|
same_proxy = gconf_client_get_bool (client, USE_SAME_PROXY_KEY, NULL);
|
||||||
|
@ -272,20 +276,23 @@ cb_use_same_proxy_checkbutton_clicked (GtkWidget *checkbutton,
|
||||||
if (same_proxy)
|
if (same_proxy)
|
||||||
{
|
{
|
||||||
/* Save the old values */
|
/* Save the old values */
|
||||||
gconf_client_set_string (client, OLD_SECURE_PROXY_HOST_KEY,
|
host = gconf_client_get_string (client, SECURE_PROXY_HOST_KEY, NULL);
|
||||||
gconf_client_get_string (client, SECURE_PROXY_HOST_KEY, NULL), NULL);
|
gconf_client_set_string (client, OLD_SECURE_PROXY_HOST_KEY, host, NULL);
|
||||||
gconf_client_set_int (client, OLD_SECURE_PROXY_PORT_KEY,
|
gconf_client_set_int (client, OLD_SECURE_PROXY_PORT_KEY,
|
||||||
gconf_client_get_int (client, SECURE_PROXY_PORT_KEY, NULL), NULL);
|
gconf_client_get_int (client, SECURE_PROXY_PORT_KEY, NULL), NULL);
|
||||||
|
g_free (host);
|
||||||
|
|
||||||
gconf_client_set_string (client, OLD_FTP_PROXY_HOST_KEY,
|
host = gconf_client_get_string (client, FTP_PROXY_HOST_KEY, NULL);
|
||||||
gconf_client_get_string (client, FTP_PROXY_HOST_KEY, NULL), NULL);
|
gconf_client_set_string (client, OLD_FTP_PROXY_HOST_KEY, host, NULL);
|
||||||
gconf_client_set_int (client, OLD_FTP_PROXY_PORT_KEY,
|
gconf_client_set_int (client, OLD_FTP_PROXY_PORT_KEY,
|
||||||
gconf_client_get_int (client, FTP_PROXY_PORT_KEY, NULL), NULL);
|
gconf_client_get_int (client, FTP_PROXY_PORT_KEY, NULL), NULL);
|
||||||
|
g_free (host);
|
||||||
|
|
||||||
gconf_client_set_string (client, OLD_SOCKS_PROXY_HOST_KEY,
|
host = gconf_client_get_string (client, SOCKS_PROXY_HOST_KEY, NULL);
|
||||||
gconf_client_get_string (client, SOCKS_PROXY_HOST_KEY, NULL), NULL);
|
gconf_client_set_string (client, OLD_SOCKS_PROXY_HOST_KEY, host, NULL);
|
||||||
gconf_client_set_int (client, OLD_SOCKS_PROXY_PORT_KEY,
|
gconf_client_set_int (client, OLD_SOCKS_PROXY_PORT_KEY,
|
||||||
gconf_client_get_int (client, SOCKS_PROXY_PORT_KEY, NULL), NULL);
|
gconf_client_get_int (client, SOCKS_PROXY_PORT_KEY, NULL), NULL);
|
||||||
|
g_free (host);
|
||||||
|
|
||||||
/* Set the new values */
|
/* Set the new values */
|
||||||
gconf_client_set_string (client, SECURE_PROXY_HOST_KEY, http_proxy, NULL);
|
gconf_client_set_string (client, SECURE_PROXY_HOST_KEY, http_proxy, NULL);
|
||||||
|
@ -299,21 +306,23 @@ cb_use_same_proxy_checkbutton_clicked (GtkWidget *checkbutton,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
host = gconf_client_get_string (client, OLD_SECURE_PROXY_HOST_KEY, NULL);
|
||||||
gconf_client_set_string (client, SECURE_PROXY_HOST_KEY,
|
gconf_client_set_string (client, SECURE_PROXY_HOST_KEY, host, NULL);
|
||||||
gconf_client_get_string (client, OLD_SECURE_PROXY_HOST_KEY, NULL), NULL);
|
|
||||||
gconf_client_set_int (client, SECURE_PROXY_PORT_KEY,
|
gconf_client_set_int (client, SECURE_PROXY_PORT_KEY,
|
||||||
gconf_client_get_int (client, OLD_SECURE_PROXY_PORT_KEY, NULL), NULL);
|
gconf_client_get_int (client, OLD_SECURE_PROXY_PORT_KEY, NULL), NULL);
|
||||||
|
g_free (host);
|
||||||
|
|
||||||
gconf_client_set_string (client, FTP_PROXY_HOST_KEY,
|
host = gconf_client_get_string (client, OLD_FTP_PROXY_HOST_KEY, NULL);
|
||||||
gconf_client_get_string (client, OLD_FTP_PROXY_HOST_KEY, NULL), NULL);
|
gconf_client_set_string (client, FTP_PROXY_HOST_KEY, host, NULL);
|
||||||
gconf_client_set_int (client, FTP_PROXY_PORT_KEY,
|
gconf_client_set_int (client, FTP_PROXY_PORT_KEY,
|
||||||
gconf_client_get_int (client, OLD_FTP_PROXY_PORT_KEY, NULL), NULL);
|
gconf_client_get_int (client, OLD_FTP_PROXY_PORT_KEY, NULL), NULL);
|
||||||
|
g_free (host);
|
||||||
|
|
||||||
gconf_client_set_string (client, SOCKS_PROXY_HOST_KEY,
|
host = gconf_client_get_string (client, OLD_SOCKS_PROXY_HOST_KEY, NULL);
|
||||||
gconf_client_get_string (client, OLD_SOCKS_PROXY_HOST_KEY, NULL), NULL);
|
gconf_client_set_string (client, SOCKS_PROXY_HOST_KEY, host, NULL);
|
||||||
gconf_client_set_int (client, SOCKS_PROXY_PORT_KEY,
|
gconf_client_set_int (client, SOCKS_PROXY_PORT_KEY,
|
||||||
gconf_client_get_int (client, OLD_SOCKS_PROXY_PORT_KEY, NULL), NULL);
|
gconf_client_get_int (client, OLD_SOCKS_PROXY_PORT_KEY, NULL), NULL);
|
||||||
|
g_free (host);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the proxy entries insensitive if we are using the same proxy for all */
|
/* Set the proxy entries insensitive if we are using the same proxy for all */
|
||||||
|
@ -515,6 +524,7 @@ setup_dialog (GladeXML *dialog)
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
GnomeProgram *program;
|
||||||
GladeXML *dialog;
|
GladeXML *dialog;
|
||||||
GConfClient *client;
|
GConfClient *client;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
@ -523,8 +533,8 @@ main (int argc, char **argv)
|
||||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||||
textdomain (GETTEXT_PACKAGE);
|
textdomain (GETTEXT_PACKAGE);
|
||||||
|
|
||||||
gnome_program_init ("gnome-network-preferences", VERSION,
|
program = gnome_program_init ("gnome-network-preferences",
|
||||||
LIBGNOMEUI_MODULE,
|
VERSION, LIBGNOMEUI_MODULE,
|
||||||
argc, argv, GNOME_PARAM_NONE);
|
argc, argv, GNOME_PARAM_NONE);
|
||||||
|
|
||||||
client = gconf_client_get_default ();
|
client = gconf_client_get_default ();
|
||||||
|
@ -544,7 +554,9 @@ main (int argc, char **argv)
|
||||||
gtk_widget_show_all (widget);
|
gtk_widget_show_all (widget);
|
||||||
gtk_main ();
|
gtk_main ();
|
||||||
|
|
||||||
|
g_object_unref (dialog);
|
||||||
g_object_unref (client);
|
g_object_unref (client);
|
||||||
|
g_object_unref (program);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue