diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-01-20 22:16:47 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-01-20 22:16:47 -0500 |
commit | 88ed5af5e444dcf8ca874fc9b8dfcf3fd35c5a03 (patch) | |
tree | 7694a1bc7ba1c49a7693a5519b85115250041b71 /gtk/a11y | |
parent | cbce906228e580102c3917c77c5159a966da067c (diff) | |
download | gtk+-88ed5af5e444dcf8ca874fc9b8dfcf3fd35c5a03.tar.gz |
Use g_signal_connect_object for adjustments in GtkSpinButtonAccessible
An instance of GtkAdjustment may be used by another instance after
the spin button widget is destroyed. In that case, the function
gtk_spin_button_accessible_value_changed() will be called with an
invalid argument. This situation is often caused when one use
GtkCellRendererSpin widget. To avoid invalid call of the function,
the signal handler for the "value-changed" signal should be disconnected
when the spin-button widget is destroyed.
Using g_signal_connect_object achieves just that.
https://bugzilla.gnome.org/show_bug.cgi?id=691592
Diffstat (limited to 'gtk/a11y')
-rw-r--r-- | gtk/a11y/gtkspinbuttonaccessible.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gtk/a11y/gtkspinbuttonaccessible.c b/gtk/a11y/gtkspinbuttonaccessible.c index d344f4e4e3..48c84ec4d0 100644 --- a/gtk/a11y/gtkspinbuttonaccessible.c +++ b/gtk/a11y/gtkspinbuttonaccessible.c @@ -51,10 +51,10 @@ gtk_spin_button_accessible_initialize (AtkObject *obj, adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (data)); if (adjustment) - g_signal_connect (adjustment, - "value-changed", - G_CALLBACK (gtk_spin_button_accessible_value_changed), - obj); + g_signal_connect_object (adjustment, + "value-changed", + G_CALLBACK (gtk_spin_button_accessible_value_changed), + obj, 0); obj->role = ATK_ROLE_SPIN_BUTTON; } @@ -71,9 +71,9 @@ gtk_spin_button_accessible_notify_gtk (GObject *obj, GtkAdjustment* adjustment; adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget)); - g_signal_connect (adjustment, "value-changed", - G_CALLBACK (gtk_spin_button_accessible_value_changed), - spin_button); + g_signal_connect_object (adjustment, "value-changed", + G_CALLBACK (gtk_spin_button_accessible_value_changed), + spin_button, 0); } else GTK_WIDGET_ACCESSIBLE_CLASS (gtk_spin_button_accessible_parent_class)->notify_gtk (obj, pspec); |