summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2012-06-18 17:54:06 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2012-06-19 08:50:46 +0100
commitcef9deae35a01173ac063993d816152204bc17b1 (patch)
tree17338b880fbc2519ceb28f6adfa9622aab9083e6
parentabba3cc56d11f32c634462a08767a99e2c142d97 (diff)
downloadclutter-cef9deae35a01173ac063993d816152204bc17b1.tar.gz
interval: Do not leak the result GValue
The compute() method will cache the result, to avoid multiple allocations and copies; this means, though, that we need to unset the GValue when destroying the Interval.
-rw-r--r--clutter/clutter-interval.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/clutter/clutter-interval.c b/clutter/clutter-interval.c
index 5f4f6d73c..c1186945a 100644
--- a/clutter/clutter-interval.c
+++ b/clutter/clutter-interval.c
@@ -307,8 +307,14 @@ clutter_interval_finalize (GObject *gobject)
{
ClutterIntervalPrivate *priv = CLUTTER_INTERVAL (gobject)->priv;
- g_value_unset (&priv->values[0]);
- g_value_unset (&priv->values[1]);
+ if (G_IS_VALUE (&priv->values[INITIAL]))
+ g_value_unset (&priv->values[INITIAL]);
+
+ if (G_IS_VALUE (&priv->values[FINAL]))
+ g_value_unset (&priv->values[FINAL]);
+
+ if (G_IS_VALUE (&priv->values[RESULT]))
+ g_value_unset (&priv->values[RESULT]);
g_free (priv->values);