mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-23 22:16:16 +01:00
gpropertyaction: Split dispose/finalize
This avoids a critical warning from trying to disconnect a signal handler from a `NULL` object if `paction->object` is `NULL` for whatever reason (see: the following commit). Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #3130
This commit is contained in:
parent
722dba7ccf
commit
525508be0d
@ -407,13 +407,25 @@ g_property_action_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
g_property_action_dispose (GObject *object)
|
||||
{
|
||||
GPropertyAction *paction = G_PROPERTY_ACTION (object);
|
||||
|
||||
if (paction->object != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (paction->object, g_property_action_notify, paction);
|
||||
g_clear_object (&paction->object);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (g_property_action_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
g_property_action_finalize (GObject *object)
|
||||
{
|
||||
GPropertyAction *paction = G_PROPERTY_ACTION (object);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (paction->object, g_property_action_notify, paction);
|
||||
g_object_unref (paction->object);
|
||||
g_free (paction->name);
|
||||
|
||||
G_OBJECT_CLASS (g_property_action_parent_class)
|
||||
@ -445,6 +457,7 @@ g_property_action_class_init (GPropertyActionClass *class)
|
||||
|
||||
object_class->set_property = g_property_action_set_property;
|
||||
object_class->get_property = g_property_action_get_property;
|
||||
object_class->dispose = g_property_action_dispose;
|
||||
object_class->finalize = g_property_action_finalize;
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user