Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/caps.c @ 25762:18fdbe507fdd
Make capstable caps.c-only and add a jabber_caps_uninit() function
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 22 Nov 2008 18:53:48 +0000 |
parents | 1b64942c5fb2 |
children | a259d2711416 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/caps.c Sat Nov 22 18:30:01 2008 +0000 +++ b/libpurple/protocols/jabber/caps.c Sat Nov 22 18:53:48 2008 +0000 @@ -41,7 +41,7 @@ char *hash; } JabberCapsKey; -GHashTable *capstable = NULL; /* JabberCapsKey -> JabberCapsClientInfo */ +static GHashTable *capstable = NULL; /* JabberCapsKey -> JabberCapsClientInfo */ /** * Processes a query-node and returns a JabberCapsClientInfo object with all relevant info. @@ -136,11 +136,18 @@ static void jabber_caps_load(void); -void jabber_caps_init(void) { +void jabber_caps_init(void) +{ capstable = g_hash_table_new_full(jabber_caps_hash, jabber_caps_compare, jabber_caps_destroy_key, jabber_caps_client_info_destroy); jabber_caps_load(); } +void jabber_caps_uninit(void) +{ + g_hash_table_destroy(capstable); + capstable = NULL; +} + static void jabber_caps_load(void) { xmlnode *capsdata = purple_util_read_xml_from_file(JABBER_CAPS_FILENAME, "XMPP capabilities cache"); xmlnode *client;