mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gparam: Remove unsynchronized write to g_type field
GValue g_type field is used for synchronization with g_once_init_enter, and so it should be written to only with g_once_init_leave. Replace structure copy with memcpy that copies the one remaining field of GValue, i.e., data array.
This commit is contained in:
parent
d72192f69b
commit
fba7f7e097
@ -1561,8 +1561,7 @@ g_param_spec_get_default_value (GParamSpec *pspec)
|
|||||||
g_param_value_set_default (pspec, &default_value);
|
g_param_value_set_default (pspec, &default_value);
|
||||||
|
|
||||||
/* store all but the type */
|
/* store all but the type */
|
||||||
default_value.g_type = 0;
|
memcpy (priv->default_value.data, default_value.data, sizeof (default_value.data));
|
||||||
priv->default_value = default_value;
|
|
||||||
|
|
||||||
g_once_init_leave (&priv->default_value.g_type, pspec->value_type);
|
g_once_init_leave (&priv->default_value.g_type, pspec->value_type);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user