pidgin.2.6.5: 7ff2a828: *** Plucked rev d1026e37e4b82add833d2a30...
datallah at pidgin.im
datallah at pidgin.im
Thu Jan 7 19:01:09 EST 2010
-----------------------------------------------------------------
Revision: 7ff2a8284187d79cff73316fc1cc1c1c425cad67
Ancestor: d24cb477161e5fc2e4f37aa757f268d5dcc7cd34
Author: datallah at pidgin.im
Date: 2010-01-07T23:47:00
Branch: im.pidgin.pidgin.2.6.5
URL: http://d.pidgin.im/viewmtn/revision/info/7ff2a8284187d79cff73316fc1cc1c1c425cad67
Modified files:
libpurple/protocols/myspace/user.c
libpurple/protocols/myspace/user.h
ChangeLog:
*** Plucked rev d1026e37e4b82add833d2a302a41c8f84e4e2bbb (cc475d6ed3e62e0458659c41bb58ac72f63d88c9):
Fix a crash when disconnecting with a pending buddy icon fetch request.
We weren't canceling our asynchronous URL fetch
*** Plucked rev 03d1409613057bd402e5659d936f59a6d201a93e (cc475d6ed3e62e0458659c41bb58ac72f63d88c9):
Two changes:
1. If we're about to make another request to fetch an icon then cancel
the first one (if it exists)
2. When freeing a buddy, only attempt to cancel a url request if it is non-NULL
-------------- next part --------------
============================================================
--- libpurple/protocols/myspace/user.c b902e0a2214de7f9c2312e75cda3ad6c7a1fc49a
+++ libpurple/protocols/myspace/user.c c5e716b2bc661bb7f1b5fe5b17fc96259f55a29a
@@ -70,6 +70,9 @@ void msim_user_free(MsimUser *user)
if (!user)
return;
+ if (user->url_data != NULL)
+ purple_util_fetch_url_cancel(user->url_data);
+
g_free(user->client_info);
g_free(user->gender);
g_free(user->location);
@@ -212,6 +215,8 @@ msim_downloaded_buddy_icon(PurpleUtilFet
const char *name = purple_buddy_get_name(user->buddy);
PurpleAccount *account;
+ user->url_data = NULL;
+
purple_debug_info("msim_downloaded_buddy_icon",
"Downloaded %" G_GSIZE_FORMAT " bytes\n", len);
@@ -375,7 +380,9 @@ msim_store_user_info_each(const gchar *k
/* Only download if URL changed */
if (!previous_url || !g_str_equal(previous_url, user->image_url)) {
- purple_util_fetch_url(user->image_url, TRUE, NULL, TRUE, msim_downloaded_buddy_icon, (gpointer)user);
+ if (user->url_data != NULL)
+ purple_util_fetch_url_cancel(user->url_data);
+ user->url_data = purple_util_fetch_url(user->image_url, TRUE, NULL, TRUE, msim_downloaded_buddy_icon, (gpointer)user);
}
} else if (g_str_equal(key_str, "LastImageUpdated")) {
/* TODO: use somewhere */
============================================================
--- libpurple/protocols/myspace/user.h 7c8a6aa909751831656cc942c610832c3ac0e9b0
+++ libpurple/protocols/myspace/user.h e79024c441cb982f1184e0ec14f09fa81eef1d2b
@@ -40,6 +40,7 @@ typedef struct _MsimUser
gchar *image_url;
guint last_image_updated;
gboolean temporary_user;
+ PurpleUtilFetchUrlData *url_data;
} MsimUser;
/* Callback function pointer type for when a user's information is received,
More information about the Commits
mailing list