diff --git a/ChangeLog b/ChangeLog index b7c6735ede..cf6e31a4c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Sep 30 15:45:49 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): + Make the reference to the mnemonic widget weak. + (#93334, Murray Cumming) + Mon Sep 30 15:38:53 2002 Owen Taylor * gdk/gdkwindow.h: Remove a duplicate definition diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b7c6735ede..cf6e31a4c9 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Mon Sep 30 15:45:49 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): + Make the reference to the mnemonic widget weak. + (#93334, Murray Cumming) + Mon Sep 30 15:38:53 2002 Owen Taylor * gdk/gdkwindow.h: Remove a duplicate definition diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index b7c6735ede..cf6e31a4c9 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Mon Sep 30 15:45:49 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): + Make the reference to the mnemonic widget weak. + (#93334, Murray Cumming) + Mon Sep 30 15:38:53 2002 Owen Taylor * gdk/gdkwindow.h: Remove a duplicate definition diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b7c6735ede..cf6e31a4c9 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Mon Sep 30 15:45:49 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): + Make the reference to the mnemonic widget weak. + (#93334, Murray Cumming) + Mon Sep 30 15:38:53 2002 Owen Taylor * gdk/gdkwindow.h: Remove a duplicate definition diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b7c6735ede..cf6e31a4c9 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Mon Sep 30 15:45:49 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): + Make the reference to the mnemonic widget weak. + (#93334, Murray Cumming) + Mon Sep 30 15:38:53 2002 Owen Taylor * gdk/gdkwindow.h: Remove a duplicate definition diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b7c6735ede..cf6e31a4c9 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Mon Sep 30 15:45:49 2002 Owen Taylor + + * gtk/gtklabel.c (gtk_label_set_mnemonic_widget): + Make the reference to the mnemonic widget weak. + (#93334, Murray Cumming) + Mon Sep 30 15:38:53 2002 Owen Taylor * gdk/gdkwindow.h: Remove a duplicate definition diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index db2d04ac78..0ca6237c5c 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -718,6 +718,15 @@ gtk_label_hierarchy_changed (GtkWidget *widget, gtk_label_setup_mnemonic (label, label->mnemonic_keyval); } +static void +label_mnemonic_widget_weak_notify (gpointer data, + GObject *where_the_object_was) +{ + GtkLabel *label = data; + + label->mnemonic_widget = NULL; + g_object_notify (G_OBJECT (label), "mnemonic_widget"); +} /** * gtk_label_set_mnemonic_widget: @@ -747,10 +756,14 @@ gtk_label_set_mnemonic_widget (GtkLabel *label, g_return_if_fail (GTK_IS_WIDGET (widget)); if (label->mnemonic_widget) - gtk_widget_unref (label->mnemonic_widget); + g_object_weak_unref (label->mnemonic_widget, + label_mnemonic_widget_weak_notify, + label); label->mnemonic_widget = widget; if (label->mnemonic_widget) - gtk_widget_ref (label->mnemonic_widget); + g_object_weak_ref (label->mnemonic_widget, + label_mnemonic_widget_weak_notify, + label); g_object_notify (G_OBJECT (label), "mnemonic_widget"); }