mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
[cogl-material] make _cogl_material_layer_free check for an invalid texture handle
It is valid in some situations to have a material layer with an invalid texture handle (e.g. if you setup a texture combine mode before setting the texture) and so _cogl_material_layer_free needs to check for a valid handle before attempting to unref it.
This commit is contained in:
parent
7e9685294e
commit
66cb117056
@ -644,6 +644,7 @@ cogl_material_set_layer_matrix (CoglHandle material_handle,
|
|||||||
static void
|
static void
|
||||||
_cogl_material_layer_free (CoglMaterialLayer *layer)
|
_cogl_material_layer_free (CoglMaterialLayer *layer)
|
||||||
{
|
{
|
||||||
|
if (layer->texture != COGL_INVALID_HANDLE)
|
||||||
cogl_handle_unref (layer->texture);
|
cogl_handle_unref (layer->texture);
|
||||||
g_free (layer);
|
g_free (layer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user