clutter/actor: Fix GValue leak when overwriting transition values

When the 'initial'/'final' values of an existing transition were being
overwritten, the GValues used in _clutter_actor_create_transition()
were not being unset.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1033
This commit is contained in:
Sebastian Keller 2020-02-01 02:57:05 +01:00 committed by Robert Mader
parent 98040e67a2
commit 2212a44cc2

View File

@ -19265,8 +19265,8 @@ _clutter_actor_create_transition (ClutterActor *actor,
gboolean call_restore = FALSE;
TransitionClosure *clos;
va_list var_args;
GValue initial = G_VALUE_INIT;
GValue final = G_VALUE_INIT;
g_auto (GValue) initial = G_VALUE_INIT;
g_auto (GValue) final = G_VALUE_INIT;
GType ptype;
char *error;
@ -19315,7 +19315,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
if (error != NULL)
{
g_critical ("%s: %s", G_STRLOC, error);
g_value_unset (&initial);
g_free (error);
goto out;
}
@ -19337,9 +19336,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
&final,
pspec);
g_value_unset (&initial);
g_value_unset (&final);
goto out;
}
@ -19387,9 +19383,6 @@ _clutter_actor_create_transition (ClutterActor *actor,
/* the actor now owns the transition */
g_object_unref (res);
g_value_unset (&initial);
g_value_unset (&final);
}
else
{