Mercurial > pidgin
changeset 17876:7a3a66c6530a
Fixed a leak: The XML parser was never cleaned up on disconnect.
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Wed, 20 Jun 2007 00:13:02 +0000 |
parents | 9edab4849ba8 |
children | 34411cc535de |
files | libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/parser.c libpurple/protocols/jabber/parser.h |
diffstat | 3 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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) {
--- 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_ */