Mercurial > pidgin.yaz
diff src/buddy.c @ 5151:ab2ae9dc9370
[gaim-migrate @ 5515]
This fixes a crash using zephyr + any other account, and a crash keeping
convo windows open after an account has disconnected, and a few other crashes,
and a crash in some code Chip hasn't written yet ;-)
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 17 Apr 2003 23:42:47 +0000 |
parents | 6d68d9edf5ae |
children | 3db711442e0f |
line wrap: on
line diff
--- a/src/buddy.c Thu Apr 17 23:40:37 2003 +0000 +++ b/src/buddy.c Thu Apr 17 23:42:47 2003 +0000 @@ -1782,7 +1782,20 @@ struct prpl *prpl = find_prpl(account->protocol); GdkPixbuf *status = NULL; char *filename = NULL; - const char *protoname = prpl->list_icon(account, NULL); + const char *protoname = NULL; + + /* this is so we can get the icon when the prpl isn't loaded. + * it's not as bad as it looks, since most of the time this function + * is called, the prpl is already loaded, so it'll just increment and + * decrement the refcount, won't have to go through the hassle of + * actually loading and unloading the prpl. the few times it actually + * does that, it saves us from crashing */ + if(prpl && prpl->list_icon) { + ref_protocol(prpl); + protoname = prpl->list_icon(account, NULL); + unref_protocol(prpl); + } + /* "Hey, what's all this crap?" you ask. Status icons will be themeable too, and then it will look up protoname from the theme */ if (!strcmp(protoname, "aim")) {