}
static inline GObjectNotifyQueue*
-g_object_notify_queue_freeze (GObject *object)
+g_object_notify_queue_freeze (GObject *object,
+ gboolean conditional)
{
GObjectNotifyQueue *nqueue;
nqueue = g_datalist_id_get_data (&object->qdata, quark_notify_queue);
if (!nqueue)
{
+ if (conditional)
+ {
+ G_UNLOCK(notify_lock);
+ return NULL;
+ }
+
nqueue = g_slice_new0 (GObjectNotifyQueue);
g_datalist_id_set_data_full (&object->qdata, quark_notify_queue,
nqueue, g_object_notify_queue_free);
if (CLASS_HAS_PROPS (class))
{
/* freeze object's notification queue, g_object_newv() preserves pairedness */
- g_object_notify_queue_freeze (object);
+ g_object_notify_queue_freeze (object, FALSE);
}
if (CLASS_HAS_CUSTOM_CONSTRUCTOR (class))
return;
g_object_ref (object);
- g_object_notify_queue_freeze (object);
+ g_object_notify_queue_freeze (object, FALSE);
g_object_unref (object);
}
if (notify_pspec != NULL)
{
- nqueue = g_object_notify_queue_freeze (object);
+ nqueue = g_object_notify_queue_freeze (object, FALSE);
g_object_notify_queue_add (object, nqueue, notify_pspec);
g_object_notify_queue_thaw (object, nqueue);
}
/* FIXME: Freezing is the only way to get at the notify queue.
* So we freeze once and then thaw twice.
*/
- nqueue = g_object_notify_queue_freeze (object);
+ nqueue = g_object_notify_queue_freeze (object, FALSE);
g_object_notify_queue_thaw (object, nqueue);
g_object_notify_queue_thaw (object, nqueue);
if (CLASS_HAS_PROPS (class))
{
if (newly_constructed || n_oparams)
- nqueue = g_object_notify_queue_freeze (object);
+ nqueue = g_object_notify_queue_freeze (object, FALSE);
if (newly_constructed)
g_object_notify_queue_thaw (object, nqueue);
}
/* set construction parameters */
if (n_construct_properties)
{
- GObjectNotifyQueue *nqueue = g_object_notify_queue_freeze (object);
+ GObjectNotifyQueue *nqueue = g_object_notify_queue_freeze (object, FALSE);
/* set construct properties */
while (n_construct_properties--)
g_return_if_fail (G_IS_OBJECT (object));
g_object_ref (object);
- nqueue = g_object_notify_queue_freeze (object);
+ nqueue = g_object_notify_queue_freeze (object, FALSE);
name = first_property_name;
while (name)
g_return_if_fail (G_IS_VALUE (value));
g_object_ref (object);
- nqueue = g_object_notify_queue_freeze (object);
+ nqueue = g_object_notify_queue_freeze (object, FALSE);
pspec = g_param_spec_pool_lookup (pspec_pool,
property_name,