mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
Merge branch 'gobject-speedup7' into 'main'
Avoid g_object_ref/unref in some cases See merge request GNOME/glib!2721
This commit is contained in:
commit
2b437402e8
@ -1342,9 +1342,15 @@ g_object_notify_by_spec_internal (GObject *object,
|
|||||||
g_object_notify_queue_thaw (object, nqueue);
|
g_object_notify_queue_thaw (object, nqueue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
g_object_ref (object);
|
||||||
|
|
||||||
/* not frozen, so just dispatch the notification directly */
|
/* not frozen, so just dispatch the notification directly */
|
||||||
G_OBJECT_GET_CLASS (object)
|
G_OBJECT_GET_CLASS (object)
|
||||||
->dispatch_properties_changed (object, 1, &pspec);
|
->dispatch_properties_changed (object, 1, &pspec);
|
||||||
|
|
||||||
|
g_object_unref (object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1375,7 +1381,6 @@ g_object_notify (GObject *object,
|
|||||||
if (g_atomic_int_get (&object->ref_count) == 0)
|
if (g_atomic_int_get (&object->ref_count) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_object_ref (object);
|
|
||||||
/* We don't need to get the redirect target
|
/* We don't need to get the redirect target
|
||||||
* (by, e.g. calling g_object_class_find_property())
|
* (by, e.g. calling g_object_class_find_property())
|
||||||
* because g_object_notify_queue_add() does that
|
* because g_object_notify_queue_add() does that
|
||||||
@ -1392,7 +1397,6 @@ g_object_notify (GObject *object,
|
|||||||
property_name);
|
property_name);
|
||||||
else
|
else
|
||||||
g_object_notify_by_spec_internal (object, pspec);
|
g_object_notify_by_spec_internal (object, pspec);
|
||||||
g_object_unref (object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1451,9 +1455,7 @@ g_object_notify_by_pspec (GObject *object,
|
|||||||
if (g_atomic_int_get (&object->ref_count) == 0)
|
if (g_atomic_int_get (&object->ref_count) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_object_ref (object);
|
|
||||||
g_object_notify_by_spec_internal (object, pspec);
|
g_object_notify_by_spec_internal (object, pspec);
|
||||||
g_object_unref (object);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user