im.pidgin.pidgin: da1974523665f0e85e669b6ecb4f9e48c136569a
datallah at pidgin.im
datallah at pidgin.im
Thu Dec 13 19:45:41 EST 2007
-----------------------------------------------------------------
Revision: da1974523665f0e85e669b6ecb4f9e48c136569a
Ancestor: 0b7c83b9abbc9390d3675566ce6bf501f86e82d5
Author: datallah at pidgin.im
Date: 2007-12-14T00:38:22
Branch: im.pidgin.pidgin
Modified files:
pidgin/gtkconn.c
ChangeLog:
Fix a GList being leaked when dealing with network connection/disconnection events.
-------------- next part --------------
============================================================
--- pidgin/gtkconn.c 56b9a1c2e1b1c647d4df32b5020c89d285915eb0
+++ pidgin/gtkconn.c c260a19fc8a2393f75d673898c66e953755690dd
@@ -184,36 +184,39 @@ static void pidgin_connection_network_co
static void pidgin_connection_network_connected ()
{
- GList *list = purple_accounts_get_all_active();
+ GList *list, *l;
PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist();
if(gtkblist)
pidgin_status_box_set_network_available(PIDGIN_STATUS_BOX(gtkblist->statusbox), TRUE);
- while (list) {
- PurpleAccount *account = (PurpleAccount*)list->data;
+ l = list = purple_accounts_get_all_active();
+ while (l) {
+ PurpleAccount *account = (PurpleAccount*)l->data;
g_hash_table_remove(auto_reconns, account);
if (purple_account_is_disconnected(account))
do_signon(account);
- list = list->next;
+ l = l->next;
}
+ g_list_free(list);
}
static void pidgin_connection_network_disconnected ()
{
- GList *l = purple_accounts_get_all_active();
+ GList *list, *l;
PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist();
PurplePluginProtocolInfo *prpl_info = NULL;
PurpleConnection *gc = NULL;
-
+
if(gtkblist)
pidgin_status_box_set_network_available(PIDGIN_STATUS_BOX(gtkblist->statusbox), FALSE);
+ l = list = purple_accounts_get_all_active();
while (l) {
PurpleAccount *a = (PurpleAccount*)l->data;
if (!purple_account_is_disconnected(a)) {
gc = purple_account_get_connection(a);
- if (gc && gc->prpl)
+ if (gc && gc->prpl)
prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
if (prpl_info) {
if (prpl_info->keepalive)
@@ -224,6 +227,7 @@ static void pidgin_connection_network_di
}
l = l->next;
}
+ g_list_free(list);
}
static void pidgin_connection_notice(PurpleConnection *gc, const char *text)
More information about the Commits
mailing list