From 4a34b693ded2215e7767b119ee27760344fd6479 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sun, 21 Jan 2018 10:37:29 -0200 Subject: [PATCH] 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. --- shell/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shell/main.c b/shell/main.c index 957dd1f20..d323582d3 100644 --- a/shell/main.c +++ b/shell/main.c @@ -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); }