fix some reference leaks and don't segfault if the glade file is not
2007-02-08 Jens Granseuer <jensgr@gmx.net> * main.c: (create_dialog), (main): fix some reference leaks and don't segfault if the glade file is not available svn path=/trunk/; revision=7264
This commit is contained in:
parent
a9b2d9ed9f
commit
c76a7cc349
2 changed files with 35 additions and 21 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2007-02-08 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
|
* main.c: (create_dialog), (main): fix some reference leaks and don't
|
||||||
|
segfault if the glade file is not available
|
||||||
|
|
||||||
2006-08-07 Willie Walker <william.walker@sun.com>
|
2006-08-07 Willie Walker <william.walker@sun.com>
|
||||||
|
|
||||||
Fixes #348630
|
Fixes #348630
|
||||||
|
|
|
@ -75,6 +75,7 @@ create_dialog (void)
|
||||||
|
|
||||||
dialog = glade_xml_new (GLADEDIR "/at-enable-dialog.glade", "at_properties_dialog", NULL);
|
dialog = glade_xml_new (GLADEDIR "/at-enable-dialog.glade", "at_properties_dialog", NULL);
|
||||||
|
|
||||||
|
if (dialog) {
|
||||||
gtk_image_set_from_stock (GTK_IMAGE (WID ("at_close_and_logout_image")),
|
gtk_image_set_from_stock (GTK_IMAGE (WID ("at_close_and_logout_image")),
|
||||||
GTK_STOCK_QUIT, GTK_ICON_SIZE_BUTTON);
|
GTK_STOCK_QUIT, GTK_ICON_SIZE_BUTTON);
|
||||||
|
|
||||||
|
@ -83,6 +84,7 @@ create_dialog (void)
|
||||||
|
|
||||||
gtk_image_set_from_file (GTK_IMAGE (WID ("at_applications_image")),
|
gtk_image_set_from_file (GTK_IMAGE (WID ("at_applications_image")),
|
||||||
PIXMAPDIR "/at-startup.png");
|
PIXMAPDIR "/at-startup.png");
|
||||||
|
}
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
@ -271,13 +273,14 @@ setup_dialog (GladeXML *dialog)
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
GnomeProgram *program;
|
||||||
GladeXML *dialog;
|
GladeXML *dialog;
|
||||||
|
|
||||||
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
||||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||||
textdomain (GETTEXT_PACKAGE);
|
textdomain (GETTEXT_PACKAGE);
|
||||||
|
|
||||||
gnome_program_init ("gnome-at-properties", VERSION,
|
program = gnome_program_init ("gnome-at-properties", VERSION,
|
||||||
LIBGNOMEUI_MODULE, argc, argv,
|
LIBGNOMEUI_MODULE, argc, argv,
|
||||||
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
|
GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -286,11 +289,17 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
dialog = create_dialog ();
|
dialog = create_dialog ();
|
||||||
|
|
||||||
|
if (dialog) {
|
||||||
init_startup_state (dialog);
|
init_startup_state (dialog);
|
||||||
|
|
||||||
setup_dialog (dialog);
|
setup_dialog (dialog);
|
||||||
|
|
||||||
gtk_main ();
|
gtk_main ();
|
||||||
|
|
||||||
|
g_object_unref (dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_unref (program);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue