[gnome-initial-setup/wip/pwithnall/misc-fixes: 11/15] timezone: Use g_autoptr() through more of GisTimezonePage




commit 177e0bd987c100e62d2dbac0a37bc61fe0669b37
Author: Philip Withnall <withnall endlessm com>
Date:   Fri Sep 11 12:13:44 2020 +0100

    timezone: Use g_autoptr() through more of GisTimezonePage
    
    This should clarify some of the ownership transfers.
    
    This introduces no functional changes.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 gnome-initial-setup/pages/timezone/gis-timezone-page.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.c 
b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
index 8a5187c5..b65e788f 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
@@ -174,13 +174,12 @@ on_geoclue_simple_ready (GObject      *source_object,
 {
   GisTimezonePage *page = user_data;
   GisTimezonePagePrivate *priv = gis_timezone_page_get_instance_private (page);
-  GError *error = NULL;
+  g_autoptr(GError) local_error = NULL;
 
-  priv->geoclue_simple = gclue_simple_new_finish (res, &error);
-  if (error != NULL)
+  priv->geoclue_simple = gclue_simple_new_finish (res, &local_error);
+  if (local_error != NULL)
     {
-      g_critical ("Failed to connect to GeoClue2 service: %s", error->message);
-      g_error_free (error);
+      g_critical ("Failed to connect to GeoClue2 service: %s", local_error->message);
       return;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]