From 0983e2cf9111f44177ec6355627beae1fb651d8e Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 26 Mar 2003 03:38:30 +0000 Subject: Undo jeff's patch below for #40275, the destroy timeout is already removed 2003-03-26 Not Zed * mail-display.c (popup_window_destroy_cb): Undo jeff's patch below for #40275, the destroy timeout is already removed in popup_info_free. Unref the widget 'w' when we're done with it. (popup_info_free): Move everything in here to popup_window_destroy and remove, since nothing else uses it. (make_popup_window): Ref the widget so it doesn't go away before we're finished with it. Really fixes bug #40275/40188. svn path=/trunk/; revision=20512 --- mail/ChangeLog | 10 ++++++++++ mail/mail-display.c | 35 ++++++++++++----------------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index a559042fb1..364a440f56 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2003-03-26 Not Zed + + * mail-display.c (popup_window_destroy_cb): Undo jeff's patch + below for #40275, the destroy timeout is already removed in + popup_info_free. Unref the widget 'w' when we're done with it. + (popup_info_free): Move everything in here to popup_window_destroy + and remove, since nothing else uses it. + (make_popup_window): Ref the widget so it doesn't go away before + we're finished with it. Really fixes bug #40275/40188. + 2003-03-25 Jeffrey Stedfast * mail-display.c (popup_window_destroy_cb): Remove the diff --git a/mail/mail-display.c b/mail/mail-display.c index 15ba0fd8f4..99ba6895df 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -2260,39 +2260,27 @@ struct _PopupInfo { /* Aiieee! Global Data! */ static GtkWidget *the_popup = NULL; -static void -popup_info_free (PopupInfo *pop) -{ - if (pop) { - if (pop->destroy_timeout) - gtk_timeout_remove (pop->destroy_timeout); - - bonobo_event_source_client_remove_listener (bonobo_widget_get_objref (BONOBO_WIDGET (pop->w)), - pop->listener, - NULL); - CORBA_Object_release (pop->listener, NULL); - g_free (pop); - } -} - static void popup_window_destroy_cb (PopupInfo *pop, GObject *deadbeef) { the_popup = NULL; - - if (pop->destroy_timeout != 0) { - gtk_timeout_remove (pop->destroy_timeout); - pop->destroy_timeout = 0; - } - - popup_info_free (pop); + + if (pop->destroy_timeout != 0) + g_source_remove(pop->destroy_timeout); + + bonobo_event_source_client_remove_listener (bonobo_widget_get_objref (BONOBO_WIDGET (pop->w)), + pop->listener, + NULL); + CORBA_Object_release (pop->listener, NULL); + g_object_unref(pop->w); + g_free (pop); } static int popup_timeout_cb (gpointer user_data) { PopupInfo *pop = (PopupInfo *) user_data; - + pop->destroy_timeout = 0; gtk_widget_destroy (pop->win); @@ -2358,6 +2346,7 @@ make_popup_window (GtkWidget *w) gtk_widget_destroy (the_popup); pop->w = w; + g_object_ref(w); the_popup = pop->win = gtk_window_new (GTK_WINDOW_POPUP); fr = gtk_frame_new (NULL); -- cgit