[gnome-logs/wip/gl-journal: 2/4] Add method to free result lists
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-logs/wip/gl-journal: 2/4] Add method to free result lists
- Date: Wed, 2 Oct 2013 19:45:28 +0000 (UTC)
commit 1dce552cec9de66ec93da700e4db62ae501b6ad9
Author: David King <davidk gnome org>
Date: Wed Oct 2 17:54:44 2013 +0100
Add method to free result lists
src/gl-journal.c | 16 ++++++++++++++++
src/gl-journal.h | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/gl-journal.c b/src/gl-journal.c
index db214e8..9d3aae0 100644
--- a/src/gl-journal.c
+++ b/src/gl-journal.c
@@ -288,6 +288,22 @@ out:
return g_list_reverse (results);
}
+static void
+gl_journal_result_free (GlJournalResult *result,
+ G_GNUC_UNUSED gpointer user_data)
+{
+ g_slice_free (GlJournalResult, result);
+}
+
+void
+gl_journal_results_free (G_GNUC_UNUSED GlJournal *self,
+ GList *results)
+{
+ /* As self is unused, ignore it. */
+ g_list_foreach (results, (GFunc)gl_journal_result_free, NULL);
+ g_list_free (results);
+}
+
sd_journal *
gl_journal_get_journal (GlJournal *self)
{
diff --git a/src/gl-journal.h b/src/gl-journal.h
index bfd5ee7..e87dff0 100644
--- a/src/gl-journal.h
+++ b/src/gl-journal.h
@@ -57,6 +57,7 @@ typedef struct
GType gl_journal_get_type (void);
GList * gl_journal_query (GlJournal *self, const GlJournalQuery *query);
+void gl_journal_results_free (G_GNUC_UNUSED GlJournal *self, GList *results);
sd_journal * gl_journal_get_journal (GlJournal *self);
GlJournal * gl_journal_new (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]