[gom] sorting: Properly free the GomOrderByTerm



commit 38ec6584b12a0cd052cfe36c1d5caac50f25050b
Author: Mathieu Bridon <bochecha daitauha fr>
Date:   Fri Jul 10 09:45:58 2015 +0200

    sorting: Properly free the GomOrderByTerm
    
    We were leaking the property_name string.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752141

 gom/gom-sorting.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gom/gom-sorting.c b/gom/gom-sorting.c
index a5a4a95..81e98fe 100644
--- a/gom/gom-sorting.c
+++ b/gom/gom-sorting.c
@@ -38,12 +38,19 @@ typedef struct GomOrderByTerm
 } GomOrderByTerm;
 
 static void
+gom_order_by_term_free (GomOrderByTerm *term)
+{
+   g_free(term->property_name);
+   g_free(term);
+}
+
+static void
 gom_sorting_finalize (GObject *object)
 {
    GomSortingPrivate *priv = GOM_SORTING(object)->priv;
 
    if (priv->order_by_terms != NULL)
-      g_queue_free_full(priv->order_by_terms, g_free);
+      g_queue_free_full(priv->order_by_terms, gom_order_by_term_free);
 
    G_OBJECT_CLASS(gom_sorting_parent_class)->finalize(object);
 }


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