# HG changeset patch # User Sadrul Habib Chowdhury # Date 1162105789 0 # Node ID 6d9db29f4c10d999fefbcb9369bbf17e32dd15b9 # Parent d478f3853671663c43e00e0d93aa03b1a292e99e [gaim-migrate @ 17617] Patch from Richard 'wabz' Nelson to fix a crash during startup if show-offline is enabled. I also noticed another crash during shutdown. Fix that one too. committer: Tailor Script diff -r d478f3853671 -r 6d9db29f4c10 console/gntblist.c --- a/console/gntblist.c Sun Oct 29 03:43:15 2006 +0000 +++ b/console/gntblist.c Sun Oct 29 07:09:49 2006 +0000 @@ -158,6 +158,13 @@ ggblist->tnode = NULL; } +static gboolean +_draw_tooltip(gpointer data) +{ + draw_tooltip(data); + return FALSE; +} + static void node_remove(GaimBuddyList *list, GaimBlistNode *node) { @@ -180,7 +187,13 @@ group->currentsize < 1) node_remove(list, node->parent); } - draw_tooltip(ggblist); + + /* When an account has signed off, it removes one buddy at a time. + * Drawing the tooltip after removing each buddy is expensive. On + * top of that, if the selected buddy belongs to the disconnected + * account, then retreiving the tooltip for that causes crash. So + * let's make sure we wait for all the buddies to be removed first.*/ + g_timeout_add(0, _draw_tooltip, ggblist); } static void @@ -1450,7 +1463,7 @@ redraw_blist(const char *name, GaimPrefType type, gconstpointer val, gpointer data) { GaimBlistNode *node, *sel; - if (ggblist == NULL) + if (ggblist == NULL || ggblist->window == NULL) return; sel = gnt_tree_get_selection_data(GNT_TREE(ggblist->tree));