aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-display.c35
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 <NotZed@Ximian.com>
+
+ * 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 <fejj@ximian.com>
* 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
@@ -2261,38 +2261,26 @@ struct _PopupInfo {
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);