shaped-texture: Prevent a critical when setting a NULL cogl texture

This commit is contained in:
Jasper St. Pierre 2013-11-26 12:35:12 -05:00
parent 37ba264190
commit 0850da44d7

View File

@ -227,10 +227,11 @@ set_cogl_texture (MetaShapedTexture *stex,
if (priv->texture)
cogl_object_unref (priv->texture);
priv->texture = cogl_object_ref (cogl_tex);
priv->texture = cogl_tex;
if (cogl_tex != NULL)
{
cogl_object_ref (cogl_tex);
width = cogl_texture_get_width (COGL_TEXTURE (cogl_tex));
height = cogl_texture_get_height (COGL_TEXTURE (cogl_tex));