diff src/status.c @ 10519:bec9130b24d2

[gaim-migrate @ 11833] Leak fixes, round #2. And some minor MSN tweaks suggested by Felipe. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 17 Jan 2005 00:33:30 +0000
parents 05081f488da1
children 54f7939df8e3
line wrap: on
line diff
--- a/src/status.c	Sat Jan 15 16:53:55 2005 +0000
+++ b/src/status.c	Mon Jan 17 00:33:30 2005 +0000
@@ -1663,7 +1663,7 @@
 	primitive_scores[index] = GPOINTER_TO_INT(value);
 }
 
-guint
+static guint
 gaim_buddy_presences_hash(gconstpointer key)
 {
 	const GaimStatusBuddyKey *me = key;
@@ -1677,7 +1677,7 @@
 	return ret;
 }
 
-gboolean
+static gboolean
 gaim_buddy_presences_equal(gconstpointer a, gconstpointer b)
 {
 	GaimStatusBuddyKey *key_a = (GaimStatusBuddyKey *)a;
@@ -1690,6 +1690,14 @@
 		return FALSE;
 }
 
+static void
+gaim_buddy_presences_key_free(gpointer a)
+{
+	GaimStatusBuddyKey *key = (GaimStatusBuddyKey *)a;
+	g_free(key->name);
+	g_free(key);
+}
+
 void *
 gaim_status_get_handle(void) {
 	static int handle;
@@ -1737,8 +1745,9 @@
 			score_pref_changed_cb,
 			GINT_TO_POINTER(SCORE_IDLE));
 
-	buddy_presences = g_hash_table_new(gaim_buddy_presences_hash,
-									   gaim_buddy_presences_equal);
+	buddy_presences = g_hash_table_new_full(gaim_buddy_presences_hash,
+											gaim_buddy_presences_equal,
+											gaim_buddy_presences_key_free, NULL);
 }
 
 void