forked from AuroraMiddleware/gtk
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
This commit is contained in:
parent
cbce906228
commit
88ed5af5e4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user