# HG changeset patch # User Mark Doliner # Date 1076771477 0 # Node ID 8a9a6eb3ded0c2ef26ab5820a1f0b89027f9d8b0 # Parent 0c5977fd3101b6326c178aa56d76f060392bdf96 [gaim-migrate @ 8977] Fix a crash bug with some shadow stuff: "To reproduce: 1) Log in to AIM/Oscar. [I don't know if other protocols will cause this bug... I only use Oscar.] 2) Mouse over a buddy to display the Info pop-up window. 3) Hit cntl-D to log out while the pop-up is still displayed... a "remnant" of the window will remain - it appears to be the window's drop shadow. 4) Click the "remnant" - segfault is immediate. Mousing over the remnant may also cause the segfault." committer: Tailor Script diff -r 0c5977fd3101 -r 8a9a6eb3ded0 src/gtkblist.c --- a/src/gtkblist.c Fri Feb 13 08:23:10 2004 +0000 +++ b/src/gtkblist.c Sat Feb 14 15:11:17 2004 +0000 @@ -418,6 +418,7 @@ /**************** END WEIRD DROP SHADOW STUFF ***********************************/ #endif + static GSList *blist_prefs_callbacks = NULL; /*************************************************** @@ -1703,6 +1704,24 @@ return; } +static void gaim_gtk_blist_tooltip_destroy() +{ + if (gtkblist->tipwindow == NULL) + return; + + gtk_widget_destroy(gtkblist->tipwindow); + gtkblist->tipwindow = NULL; +#ifdef WANT_DROP_SHADOW + gdk_window_set_user_data (gtkblist->east_shadow, NULL); + gdk_window_destroy (gtkblist->east_shadow); + gtkblist->east_shadow = NULL; + + gdk_window_set_user_data (gtkblist->south_shadow, NULL); + gdk_window_destroy (gtkblist->south_shadow); + gtkblist->south_shadow = NULL; +#endif +} + static gboolean gaim_gtk_blist_tooltip_timeout(GtkWidget *tv) { GtkTreePath *path; @@ -1873,20 +1892,7 @@ if ((event->y > gtkblist->tip_rect.y) && ((event->y - gtkblist->tip_rect.height) < gtkblist->tip_rect.y)) return FALSE; /* We've left the cell. Remove the timeout and create a new one below */ - if (gtkblist->tipwindow) { - gtk_widget_destroy(gtkblist->tipwindow); -#ifdef WANT_DROP_SHADOW - gdk_window_set_user_data (gtkblist->east_shadow, NULL); - gdk_window_destroy (gtkblist->east_shadow); - gtkblist->east_shadow = NULL; - - gdk_window_set_user_data (gtkblist->south_shadow, NULL); - gdk_window_destroy (gtkblist->south_shadow); - gtkblist->south_shadow = NULL; -#endif - gtkblist->tipwindow = NULL; - } - + gaim_gtk_blist_tooltip_destroy(); g_source_remove(gtkblist->timeout); } @@ -1913,19 +1919,7 @@ g_source_remove(gtkblist->timeout); gtkblist->timeout = 0; } - if (gtkblist->tipwindow) { - gtk_widget_destroy(gtkblist->tipwindow); -#ifdef WANT_DROP_SHADOW - gdk_window_set_user_data (gtkblist->east_shadow, NULL); - gdk_window_destroy (gtkblist->east_shadow); - gtkblist->east_shadow = NULL; - - gdk_window_set_user_data (gtkblist->south_shadow, NULL); - gdk_window_destroy (gtkblist->south_shadow); - gtkblist->south_shadow = NULL; -#endif - gtkblist->tipwindow = NULL; - } + gaim_gtk_blist_tooltip_destroy(); if (gtkblist->mouseover_contact && !((e->x > gtkblist->contact_rect.x) && (e->x < (gtkblist->contact_rect.x + gtkblist->contact_rect.width)) && @@ -3384,8 +3378,7 @@ gtk_widget_destroy(gtkblist->window); - if (gtkblist->tipwindow) - gtk_widget_destroy(gtkblist->tipwindow); + gaim_gtk_blist_tooltip_destroy(); gtk_object_sink(GTK_OBJECT(gtkblist->tooltips)); @@ -3400,7 +3393,7 @@ gtkblist->treemodel = NULL; gtkblist->idle_column = NULL; gtkblist->warning_column = gtkblist->buddy_icon_column = NULL; - gtkblist->bbox = gtkblist->tipwindow = NULL; + gtkblist->bbox = NULL; g_object_unref(G_OBJECT(gtkblist->ift)); protomenu = NULL; awaymenu = NULL;