Mercurial > pidgin.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
10518:8ae540ad42e7 | 10519:bec9130b24d2 |
---|---|
1661 int index = GPOINTER_TO_INT(data); | 1661 int index = GPOINTER_TO_INT(data); |
1662 | 1662 |
1663 primitive_scores[index] = GPOINTER_TO_INT(value); | 1663 primitive_scores[index] = GPOINTER_TO_INT(value); |
1664 } | 1664 } |
1665 | 1665 |
1666 guint | 1666 static guint |
1667 gaim_buddy_presences_hash(gconstpointer key) | 1667 gaim_buddy_presences_hash(gconstpointer key) |
1668 { | 1668 { |
1669 const GaimStatusBuddyKey *me = key; | 1669 const GaimStatusBuddyKey *me = key; |
1670 guint ret; | 1670 guint ret; |
1671 char *str; | 1671 char *str; |
1675 g_free(str); | 1675 g_free(str); |
1676 | 1676 |
1677 return ret; | 1677 return ret; |
1678 } | 1678 } |
1679 | 1679 |
1680 gboolean | 1680 static gboolean |
1681 gaim_buddy_presences_equal(gconstpointer a, gconstpointer b) | 1681 gaim_buddy_presences_equal(gconstpointer a, gconstpointer b) |
1682 { | 1682 { |
1683 GaimStatusBuddyKey *key_a = (GaimStatusBuddyKey *)a; | 1683 GaimStatusBuddyKey *key_a = (GaimStatusBuddyKey *)a; |
1684 GaimStatusBuddyKey *key_b = (GaimStatusBuddyKey *)b; | 1684 GaimStatusBuddyKey *key_b = (GaimStatusBuddyKey *)b; |
1685 | 1685 |
1686 if(key_a->account == key_b->account && | 1686 if(key_a->account == key_b->account && |
1687 !strcmp(key_a->name, key_b->name)) | 1687 !strcmp(key_a->name, key_b->name)) |
1688 return TRUE; | 1688 return TRUE; |
1689 else | 1689 else |
1690 return FALSE; | 1690 return FALSE; |
1691 } | |
1692 | |
1693 static void | |
1694 gaim_buddy_presences_key_free(gpointer a) | |
1695 { | |
1696 GaimStatusBuddyKey *key = (GaimStatusBuddyKey *)a; | |
1697 g_free(key->name); | |
1698 g_free(key); | |
1691 } | 1699 } |
1692 | 1700 |
1693 void * | 1701 void * |
1694 gaim_status_get_handle(void) { | 1702 gaim_status_get_handle(void) { |
1695 static int handle; | 1703 static int handle; |
1735 GINT_TO_POINTER(GAIM_STATUS_EXTENDED_AWAY)); | 1743 GINT_TO_POINTER(GAIM_STATUS_EXTENDED_AWAY)); |
1736 gaim_prefs_connect_callback(handle, "/core/status/scores/idle", | 1744 gaim_prefs_connect_callback(handle, "/core/status/scores/idle", |
1737 score_pref_changed_cb, | 1745 score_pref_changed_cb, |
1738 GINT_TO_POINTER(SCORE_IDLE)); | 1746 GINT_TO_POINTER(SCORE_IDLE)); |
1739 | 1747 |
1740 buddy_presences = g_hash_table_new(gaim_buddy_presences_hash, | 1748 buddy_presences = g_hash_table_new_full(gaim_buddy_presences_hash, |
1741 gaim_buddy_presences_equal); | 1749 gaim_buddy_presences_equal, |
1750 gaim_buddy_presences_key_free, NULL); | |
1742 } | 1751 } |
1743 | 1752 |
1744 void | 1753 void |
1745 gaim_status_uninit(void) | 1754 gaim_status_uninit(void) |
1746 { | 1755 { |