summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLogan Rathbone <poprocks@gmail.com>2021-12-29 23:49:48 -0500
committerLogan Rathbone <poprocks@gmail.com>2021-12-29 23:49:48 -0500
commit6da301644c82049dc7d0b4a701a481000379893f (patch)
tree4bbae604b7bc92b30d496e322f10c06d845c0e91 /src/main.c
parent7db5575f2bba510a88aa56d0bcb295b9a07ab104 (diff)
downloadzenity-6da301644c82049dc7d0b4a701a481000379893f.tar.gz
Use g_auto* where possible.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index 01545be..86a816b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -43,7 +43,7 @@ command_line_cb (GtkApplication *app,
GApplicationCommandLine *command_line,
gpointer user_data)
{
- ZenityArgs *args = user_data;
+ g_autofree ZenityArgs *args = user_data;
ZenityParsingOptions *results;
results = zenity_option_parse (args->argc, args->argv);
@@ -120,18 +120,13 @@ command_line_cb (GtkApplication *app,
case MODE_LAST:
g_printerr (_ ("You must specify a dialog type. See 'zenity "
"--help' for details\n"));
- zenity_option_free ();
exit (-1);
default:
g_assert_not_reached ();
- zenity_option_free ();
exit (-1);
}
- zenity_option_free ();
- g_free (args);
-
g_application_command_line_set_exit_status (command_line,
results->data->exit_code);
}
@@ -139,11 +134,11 @@ command_line_cb (GtkApplication *app,
int
main (int argc, char *argv[])
{
- ZenityArgs *args;
- GtkApplication *app;
+ g_autofree ZenityArgs *args = NULL;
+ g_autoptr(GtkApplication) app = NULL;
int status;
- /* boilerplate i18n stuff */
+ /* <i18n> */
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@@ -162,7 +157,6 @@ main (int argc, char *argv[])
G_CALLBACK(command_line_cb), args);
status = g_application_run (G_APPLICATION(app), 0, NULL);
- g_object_unref (app);
return status;
}