diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-08 23:22:16 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-08 23:22:16 +0100 | 
| commit | d50e22f72987597152198811a22e50a97a902bcc (patch) | |
| tree | e6bca75114214dd7669bd91c9d977f50e8c09390 /protocols | |
| parent | f1cea66ac5fcd860b2702e6b8ab01fcb79179bd4 (diff) | |
| parent | 04a927cb733e2c47424569550a2faeb108094636 (diff) | |
Merging memory leak fixes from devel, time to find the ui-fix-specific
leaks.
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/jabber/jabber.c | 2 | ||||
| -rw-r--r-- | protocols/jabber/jabber.h | 1 | ||||
| -rw-r--r-- | protocols/jabber/jabber_util.c | 26 | ||||
| -rw-r--r-- | protocols/twitter/twitter.c | 2 | 
4 files changed, 31 insertions, 0 deletions
| diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 75bc44d3..cf491f81 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -299,6 +299,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 5be7978b..b3638597 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -291,6 +291,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 608cb52a..ab3e6c38 100644 --- a/protocols/jabber/jabber_util.c +++ b/protocols/jabber/jabber_util.c @@ -668,6 +668,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 );  	} | 
