[template-glib] locator: free search path



commit 2e22a033fd7676adfa875b53bae0b1775efe8421
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jul 27 23:32:31 2018 -0700

    locator: free search path

 src/tmpl-template-locator.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
diff --git a/src/tmpl-template-locator.c b/src/tmpl-template-locator.c
index 8223946..b57b80d 100644
--- a/src/tmpl-template-locator.c
+++ b/src/tmpl-template-locator.c
@@ -122,9 +122,25 @@ tmpl_template_locator_real_locate (TmplTemplateLocator  *self,
   return ret;
 }
 
+static void
+tmpl_template_locator_finalize (GObject *object)
+{
+  TmplTemplateLocator *self = (TmplTemplateLocator *)object;
+  TmplTemplateLocatorPrivate *priv = tmpl_template_locator_get_instance_private (self);
+
+  g_queue_free_full (priv->search_path, g_free);
+  priv->search_path = NULL;
+
+  G_OBJECT_CLASS (tmpl_template_locator_parent_class)->finalize (object);
+}
+
 static void
 tmpl_template_locator_class_init (TmplTemplateLocatorClass *klass)
 {
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = tmpl_template_locator_finalize;
+
   klass->locate = tmpl_template_locator_real_locate;
 }
 


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