[empathy: 19/80] Add _tpl_action_chain_clear



commit 9f9677ec63954a870daadfedd51359a631c43ea2
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Mon Apr 25 12:07:59 2011 +0100

    Add _tpl_action_chain_clear

 libempathy/action-chain-internal.h |    1 +
 libempathy/action-chain.c          |    7 +++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/action-chain-internal.h b/libempathy/action-chain-internal.h
index d2395d1..14750c9 100644
--- a/libempathy/action-chain-internal.h
+++ b/libempathy/action-chain-internal.h
@@ -42,6 +42,7 @@ void _tpl_action_chain_prepend (TplActionChain *self, TplPendingAction func,
 void _tpl_action_chain_start (TplActionChain *self);
 void _tpl_action_chain_continue (TplActionChain *self);
 void _tpl_action_chain_terminate (TplActionChain *self, const GError *error);
+void _tpl_action_chain_clear (TplActionChain *self);
 
 gpointer _tpl_action_chain_get_object (TplActionChain *self);
 gboolean _tpl_action_chain_new_finish (GObject *source,
diff --git a/libempathy/action-chain.c b/libempathy/action-chain.c
index 30217dd..b6bf25a 100644
--- a/libempathy/action-chain.c
+++ b/libempathy/action-chain.c
@@ -137,6 +137,13 @@ _tpl_action_chain_continue (TplActionChain *self)
 
 
 void
+_tpl_action_chain_clear (TplActionChain *self)
+{
+  g_queue_foreach (self->chain, (GFunc) link_free, NULL);
+  g_queue_clear (self->chain);
+}
+
+void
 _tpl_action_chain_terminate (TplActionChain *self,
     const GError *error)
 {



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