mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
[notify] dispatch 'notify' directly if not frozen
Avoid the notify queue in the case that we're not already frozen.
This commit is contained in:
parent
39458748dd
commit
ac0ddcf23f
@ -1090,16 +1090,27 @@ static inline void
|
|||||||
g_object_notify_by_spec_internal (GObject *object,
|
g_object_notify_by_spec_internal (GObject *object,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GObjectNotifyQueue *nqueue;
|
|
||||||
GParamSpec *notify_pspec;
|
GParamSpec *notify_pspec;
|
||||||
|
|
||||||
notify_pspec = get_notify_pspec (pspec);
|
notify_pspec = get_notify_pspec (pspec);
|
||||||
|
|
||||||
if (notify_pspec != NULL)
|
if (notify_pspec != NULL)
|
||||||
{
|
{
|
||||||
nqueue = g_object_notify_queue_freeze (object, FALSE);
|
GObjectNotifyQueue *nqueue;
|
||||||
g_object_notify_queue_add (object, nqueue, notify_pspec);
|
|
||||||
g_object_notify_queue_thaw (object, nqueue);
|
/* conditional freeze: only increase freeze count if already frozen */
|
||||||
|
nqueue = g_object_notify_queue_freeze (object, TRUE);
|
||||||
|
|
||||||
|
if (nqueue != NULL)
|
||||||
|
{
|
||||||
|
/* we're frozen, so add to the queue and release our freeze */
|
||||||
|
g_object_notify_queue_add (object, nqueue, notify_pspec);
|
||||||
|
g_object_notify_queue_thaw (object, nqueue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* not frozen, so just dispatch the notification directly */
|
||||||
|
G_OBJECT_GET_CLASS (object)
|
||||||
|
->dispatch_properties_changed (object, 1, ¬ify_pspec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user