mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
cogl-material: Unref the texture when reverting authority
When the texture is set on a layer so that it is back to the parent's texture it would clear the texture change flag but it wouldn't unref the texture. The free function for a material layer does not unref the texture if the change flag is cleared so the texture would end up leaking. This happens for ClutterTexture because it disposes the texture by setting layer 0 of the material to COGL_INVALID_HANDLE which ends up the same as the default material.
This commit is contained in:
parent
eda852e78c
commit
abea3d7ead
@ -1900,6 +1900,9 @@ _cogl_material_set_layer_texture (CoglMaterial *material,
|
||||
{
|
||||
layer->differences &= ~change;
|
||||
|
||||
if (layer->texture != COGL_INVALID_HANDLE)
|
||||
cogl_handle_unref (layer->texture);
|
||||
|
||||
g_assert (layer->owner == material);
|
||||
if (layer->differences == 0)
|
||||
_cogl_material_prune_empty_layer_difference (material,
|
||||
|
Loading…
Reference in New Issue
Block a user