Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/slist.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/slist.h')
-rw-r--r--src/slist.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/slist.h b/src/slist.h
index f7c7ae9..8c80fa8 100644
--- a/src/slist.h
+++ b/src/slist.h
@@ -32,13 +32,19 @@ slist_new(SList *self)
}
inline void
-slist_free(SList *self)
+slist_clean(SList *self)
{
GSList *i;
-
+ g_mutex_lock(self->lock);
for (i = self->list; i; i = g_slist_next(i))
text_unref(i->data);
+ g_mutex_unlock(self->lock);
+}
+inline void
+slist_free(SList *self)
+{
+ slist_clean(self);
g_slist_free(self->list);
g_mutex_free(self->lock);
}