gail: use a weak pointer instead of an invalid destroy signal
This commit is contained in:
@ -43,9 +43,6 @@ static void gail_adjustment_get_minimum_increment (AtkValue *obj,
|
|||||||
static gboolean gail_adjustment_set_current_value (AtkValue *obj,
|
static gboolean gail_adjustment_set_current_value (AtkValue *obj,
|
||||||
const GValue *value);
|
const GValue *value);
|
||||||
|
|
||||||
static void gail_adjustment_destroyed (GtkAdjustment *adjustment,
|
|
||||||
GailAdjustment *gail_adjustment);
|
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GailAdjustment, gail_adjustment, ATK_TYPE_OBJECT,
|
G_DEFINE_TYPE_WITH_CODE (GailAdjustment, gail_adjustment, ATK_TYPE_OBJECT,
|
||||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
|
G_IMPLEMENT_INTERFACE (ATK_TYPE_VALUE, atk_value_interface_init))
|
||||||
|
|
||||||
@ -83,18 +80,18 @@ gail_adjustment_real_initialize (AtkObject *obj,
|
|||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GtkAdjustment *adjustment;
|
GtkAdjustment *adjustment;
|
||||||
|
GailAdjustment *gail_adjustment;
|
||||||
|
|
||||||
ATK_OBJECT_CLASS (gail_adjustment_parent_class)->initialize (obj, data);
|
ATK_OBJECT_CLASS (gail_adjustment_parent_class)->initialize (obj, data);
|
||||||
|
|
||||||
adjustment = GTK_ADJUSTMENT (data);
|
adjustment = GTK_ADJUSTMENT (data);
|
||||||
|
|
||||||
obj->role = ATK_ROLE_UNKNOWN;
|
obj->role = ATK_ROLE_UNKNOWN;
|
||||||
GAIL_ADJUSTMENT (obj)->adjustment = adjustment;
|
gail_adjustment = GAIL_ADJUSTMENT (obj);
|
||||||
|
gail_adjustment->adjustment = adjustment;
|
||||||
|
|
||||||
g_signal_connect_object (G_OBJECT (adjustment),
|
g_object_add_weak_pointer (G_OBJECT (adjustment),
|
||||||
"destroy",
|
(gpointer *) &gail_adjustment->adjustment);
|
||||||
G_CALLBACK (gail_adjustment_destroyed),
|
|
||||||
obj, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -231,14 +228,3 @@ gail_adjustment_set_current_value (AtkValue *obj,
|
|||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gail_adjustment_destroyed (GtkAdjustment *adjustment,
|
|
||||||
GailAdjustment *gail_adjustment)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* This is the signal handler for the "destroy" signal for the
|
|
||||||
* GtkAdjustment. We set the pointer location to NULL;
|
|
||||||
*/
|
|
||||||
gail_adjustment->adjustment = NULL;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user