GLeaker

GLeaker Commit Details

Date:2013-04-10 11:55:47 (4 years 9 months ago)
Author:Nicola Fontana
Branch:master
Commit:7f2979a127a531d548221f86eb58a3e666bd6f39
Parents: 1329de9d739730f9fac5af7f7be2cfdeb28154dd
Message:Do not use g_error() for expected errors

This is suggested by the g_error() documentation: calling it will
result in a core dump.
Changes:
Msrc/gleaker.c (1 diff)

File differences

src/gleaker.c
3030
3131
3232
33
34
33
34
3535
3636
3737
3838
3939
40
40
4141
4242
43
43
44
4445
4546
4647
47
48
4849
50
4951
52
53
5054
5155
5256
5357
5458
5559
56
60
61
5762
5863
5964
exit(0);
}
static void
parse_args(gint *p_argc, gchar **p_argv[])
static gboolean
parse_args(gint *p_argc, gchar ***p_argv)
{
GError *error = NULL;
GOptionEntry entries[] = {
{"version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
version, "Display version information", NULL},
{NULL}
{ NULL, 0, }
};
gtk_init_with_args(p_argc, p_argv, _("- An application for handling leak detection systems"),
gtk_init_with_args(p_argc, p_argv,
_("- An application for handling leak detection systems"),
entries, NULL, &error);
if (error != NULL) {
g_error("%s", error->message);
g_critical("%s", error->message);
g_error_free(error);
return FALSE;
}
return TRUE;
}
gint
main(gint argc, gchar **argv)
{
parse_args(&argc, &argv);
if (! parse_args(&argc, &argv))
return 1;
return 0;
}

Archive Download the corresponding diff file

Branches