material: unlink old layer from owner when replacing

In _cogl_material_layer_pre_change_notify when we see that a layer has
dependants and it can't be modified directly then we allocate a new
layer. In this case we also have to link the new layer to its required
owner. If the immutable layer we copied had the same owner though we
weren't unlinking that old layer.
This commit is contained in:
Robert Bragg 2010-08-08 14:26:45 +01:00
parent 021265e634
commit b493b30257

View File

@ -1451,6 +1451,8 @@ _cogl_material_layer_pre_change_notify (CoglMaterial *required_owner,
layer->owner != required_owner)
{
CoglMaterialLayer *new = _cogl_material_layer_copy (layer);
if (layer->owner == required_owner)
_cogl_material_remove_layer_difference (required_owner, layer, FALSE);
_cogl_material_add_layer_difference (required_owner, new, FALSE);
cogl_object_unref (new);
layer = new;