# HG changeset patch # User Andreas Monitzer # Date 1182298382 0 # Node ID 7a3a66c6530a3487317a5a27879b06ca61947087 # Parent 9edab4849ba85d356f0db8a89b5347613d422210 Fixed a leak: The XML parser was never cleaned up on disconnect. diff -r 9edab4849ba8 -r 7a3a66c6530a libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Tue Jun 19 23:54:52 2007 +0000 +++ b/libpurple/protocols/jabber/jabber.c Wed Jun 20 00:13:02 2007 +0000 @@ -622,6 +622,8 @@ { JabberStream *js = data; PurpleAccount *account = purple_connection_get_account(js->gc); + + jabber_parser_free(js); purple_account_disconnect(account); @@ -1055,6 +1057,8 @@ jabber_buddy_remove_all_pending_buddy_info_requests(js); + jabber_parser_free(js); + if(js->iq_callbacks) g_hash_table_destroy(js->iq_callbacks); if(js->disco_callbacks) diff -r 9edab4849ba8 -r 7a3a66c6530a libpurple/protocols/jabber/parser.c --- a/libpurple/protocols/jabber/parser.c Tue Jun 19 23:54:52 2007 +0000 +++ b/libpurple/protocols/jabber/parser.c Wed Jun 20 00:13:02 2007 +0000 @@ -174,6 +174,10 @@ * the parser context when you try to use it (this way, it can figure * out the encoding at creation time. So, setting up the parser is * just a matter of destroying any current parser. */ + jabber_parser_free(js); +} + +void jabber_parser_free(JabberStream *js) { if (js->context) { xmlParseChunk(js->context, NULL,0,1); xmlFreeParserCtxt(js->context); @@ -181,7 +185,6 @@ } } - void jabber_parser_process(JabberStream *js, const char *buf, int len) { if (js->context == NULL) { diff -r 9edab4849ba8 -r 7a3a66c6530a libpurple/protocols/jabber/parser.h --- a/libpurple/protocols/jabber/parser.h Tue Jun 19 23:54:52 2007 +0000 +++ b/libpurple/protocols/jabber/parser.h Wed Jun 20 00:13:02 2007 +0000 @@ -25,6 +25,7 @@ #include "jabber.h" void jabber_parser_setup(JabberStream *js); +void jabber_parser_free(JabberStream *js); void jabber_parser_process(JabberStream *js, const char *buf, int len); #endif /* _PURPLE_JABBER_PARSER_H_ */