aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--protocols/jabber/jabber.c2
-rw-r--r--protocols/jabber/jabber.h1
-rw-r--r--protocols/jabber/jabber_util.c26
-rw-r--r--protocols/twitter/twitter.c2
4 files changed, 31 insertions, 0 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index 86320ada..8bb44691 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -285,6 +285,8 @@ static void jabber_logout( struct im_connection *ic )
if( jd->node_cache )
g_hash_table_destroy( jd->node_cache );
+ jabber_buddy_remove_all( ic );
+
xt_free( jd->xt );
g_free( jd->away_message );
diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h
index 40cf3957..3f4144b8 100644
--- a/protocols/jabber/jabber.h
+++ b/protocols/jabber/jabber.h
@@ -229,6 +229,7 @@ struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid, g
struct jabber_buddy *jabber_buddy_by_ext_jid( struct im_connection *ic, char *jid, get_buddy_flags_t flags );
int jabber_buddy_remove( struct im_connection *ic, char *full_jid );
int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid );
+void jabber_buddy_remove_all( struct im_connection *ic );
time_t jabber_get_timestamp( struct xt_node *xt );
struct jabber_error *jabber_error_parse( struct xt_node *node, char *xmlns );
void jabber_error_free( struct jabber_error *err );
diff --git a/protocols/jabber/jabber_util.c b/protocols/jabber/jabber_util.c
index b8b625f7..651b7068 100644
--- a/protocols/jabber/jabber_util.c
+++ b/protocols/jabber/jabber_util.c
@@ -664,6 +664,32 @@ int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid )
}
}
+static gboolean jabber_buddy_remove_all_cb( gpointer key, gpointer value, gpointer data )
+{
+ struct jabber_buddy *bud, *next;
+
+ bud = value;
+ while( bud )
+ {
+ next = bud->next;
+ g_free( bud->ext_jid );
+ g_free( bud->full_jid );
+ g_free( bud->away_message );
+ g_free( bud );
+ bud = next;
+ }
+
+ return TRUE;
+}
+
+void jabber_buddy_remove_all( struct im_connection *ic )
+{
+ struct jabber_data *jd = ic->proto_data;
+
+ g_hash_table_foreach_remove( jd->buddies, jabber_buddy_remove_all_cb, NULL );
+ g_hash_table_destroy( jd->buddies );
+}
+
time_t jabber_get_timestamp( struct xt_node *xt )
{
struct xt_node *c;
diff --git a/protocols/twitter/twitter.c b/protocols/twitter/twitter.c
index a5fc68ab..db893e17 100644
--- a/protocols/twitter/twitter.c
+++ b/protocols/twitter/twitter.c
@@ -235,6 +235,8 @@ static void twitter_logout( struct im_connection *ic )
if( td )
{
oauth_info_free( td->oauth_info );
+ g_free( td->url_host );
+ g_free( td->url_path );
g_free( td->pass );
g_free( td );
}