[clutter-texture] Release the temporary ref taken when setting a texture

When setting the cogl texture, the ClutterTexture takes a reference to
the Cogl handle but the material takes an additional reference when it
is set as the layer. Nothing was unrefing the temporary reference so
the textures were being leaked.
This commit is contained in:
Neil Roberts 2009-02-05 18:26:08 +00:00
parent 8feb99722c
commit ee0bf5e26d

View File

@ -1299,6 +1299,10 @@ clutter_texture_set_cogl_texture (ClutterTexture *texture,
cogl_material_set_layer (priv->material, 0, cogl_tex);
/* The material now holds a reference to the texture so we can
safely release the reference we claimed above */
cogl_texture_unref (cogl_tex);
size_change = width != priv->width || height != priv->height;
priv->width = width;
priv->height = height;