[gnome-photos/wip/rishi/use-g-auto-02: 1/3] search-controller: Use g_auto*




commit a29f1762e5a100c33dfe2678725030e0e011728e
Author: Debarshi Ray <debarshir gnome org>
Date:   Sat Mar 27 20:51:18 2021 +0100

    search-controller: Use g_auto*
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/77

 src/photos-search-controller.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-search-controller.c b/src/photos-search-controller.c
index 89a9478f..3d08587a 100644
--- a/src/photos-search-controller.c
+++ b/src/photos-search-controller.c
@@ -102,16 +102,14 @@ photos_search_controller_get_string (PhotosSearchController *self)
 gchar **
 photos_search_controller_get_terms (PhotosSearchController *self)
 {
-  gchar *escaped_str;
-  gchar *str;
+  g_autofree gchar *escaped_str = NULL;
+  g_autofree gchar *str = NULL;
   gchar **terms;
 
   escaped_str = tracker_sparql_escape_string (self->str);
   str = g_utf8_casefold (escaped_str, -1);
   /* TODO: find out what str.replace(/ + /g, ' ') does */
   terms = g_strsplit (str, " ", -1);
-  g_free (str);
-  g_free (escaped_str);
   return terms;
 }
 


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