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:
parent
eda492aab4
commit
4a34b693de
1 changed files with 2 additions and 6 deletions
|
@ -38,8 +38,7 @@
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GtkApplication *application;
|
g_autoptr(GtkApplication) application = NULL;
|
||||||
int status;
|
|
||||||
|
|
||||||
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
|
||||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||||
|
@ -54,9 +53,6 @@ main (int argc, char **argv)
|
||||||
#endif /* HAVE_CHEESE */
|
#endif /* HAVE_CHEESE */
|
||||||
|
|
||||||
application = cc_application_new ();
|
application = cc_application_new ();
|
||||||
status = g_application_run (G_APPLICATION (application), argc, argv);
|
|
||||||
|
|
||||||
g_object_unref (application);
|
return g_application_run (G_APPLICATION (application), argc, argv);
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue