[gnome-initial-setup/wjt/more-timezone-fixes: 4/5] location-entry: Don't leak GeocodePlaces




commit bc2a25c2575c38775751a295e8b7ad8fe15d4d1b
Author: Will Thompson <wjt endlessos org>
Date:   Tue Aug 16 10:00:23 2022 +0100

    location-entry: Don't leak GeocodePlaces
    
    geocode_forward_search_finish() returns a transfer full list of GeocodePlace *.
    Previously the list was freed but its contents were not unref'd.

 gnome-initial-setup/pages/timezone/gis-location-entry.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gnome-initial-setup/pages/timezone/gis-location-entry.c 
b/gnome-initial-setup/pages/timezone/gis-location-entry.c
index 8b784f3e..53756427 100644
--- a/gnome-initial-setup/pages/timezone/gis-location-entry.c
+++ b/gnome-initial-setup/pages/timezone/gis-location-entry.c
@@ -800,7 +800,7 @@ _got_places (GObject      *source_object,
              GAsyncResult *result,
              gpointer      user_data)
 {
-    GList *places;
+    g_autolist(GeocodePlace) places = NULL;
     GisLocationEntry *self = NULL;
     g_autoptr(GError) error = NULL;
     GtkListStore *store = NULL;
@@ -827,7 +827,6 @@ _got_places (GObject      *source_object,
     gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store),
                                              tree_compare_local_name, NULL, NULL);
     g_list_foreach (places, fill_store, store);
-    g_list_free (places);
     gtk_entry_completion_set_match_func (completion, new_matcher, NULL, NULL);
     gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (store));
     g_object_unref (store);


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