clutter/actor: Use g_set_str to duplicate owned strings
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
This commit is contained in:
parent
5ef581d8bd
commit
9872512c8a
1 changed files with 2 additions and 6 deletions
|
@ -10423,8 +10423,7 @@ clutter_actor_set_name (ClutterActor *self,
|
||||||
{
|
{
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
|
||||||
g_free (self->priv->name);
|
g_set_str (&self->priv->name, name);
|
||||||
self->priv->name = g_strdup (name);
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_NAME]);
|
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_NAME]);
|
||||||
}
|
}
|
||||||
|
@ -18711,11 +18710,8 @@ clutter_actor_set_accessible_name (ClutterActor *self,
|
||||||
if (g_strcmp0 (name, priv->accessible_name) == 0)
|
if (g_strcmp0 (name, priv->accessible_name) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (priv->accessible_name != NULL)
|
|
||||||
g_free (priv->accessible_name);
|
|
||||||
|
|
||||||
accessible = clutter_actor_get_accessible (self);
|
accessible = clutter_actor_get_accessible (self);
|
||||||
priv->accessible_name = g_strdup (name);
|
g_set_str (&priv->accessible_name, name);
|
||||||
|
|
||||||
if (accessible)
|
if (accessible)
|
||||||
g_object_notify (G_OBJECT (accessible), "accessible-name");
|
g_object_notify (G_OBJECT (accessible), "accessible-name");
|
||||||
|
|
Loading…
Reference in a new issue