main: Use g_autoptr to simplify code

With g_autoptr, we don't need to manually unref the
GtkApplication before returning its status. This
saves a few lines of code.
This commit is contained in:
Georges Basile Stavracas Neto 2018-01-21 10:37:29 -02:00
parent eda492aab4
commit 4a34b693de

View file

@ -38,8 +38,7 @@
int
main (int argc, char **argv)
{
GtkApplication *application;
int status;
g_autoptr(GtkApplication) application = NULL;
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@ -54,9 +53,6 @@ main (int argc, char **argv)
#endif /* HAVE_CHEESE */
application = cc_application_new ();
status = g_application_run (G_APPLICATION (application), argc, argv);
g_object_unref (application);
return status;
return g_application_run (G_APPLICATION (application), argc, argv);
}