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
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue