mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 04:22:05 +00:00
material: don't keep extra ref on copy-on-write materials
In _cogl_material_pre_change_notify if a material with descendants is modified then we create a new material that is a copy of the one being modified and reparent those descendants to the new material. This patch ensures we drop the reference we get from cogl_material_copy since we can rely on the descendants to keep the new material alive.
This commit is contained in:
parent
3428633cb3
commit
cc0b76b405
@ -1199,6 +1199,10 @@ _cogl_material_pre_change_notify (CoglMaterial *material,
|
|||||||
_cogl_material_foreach_child (material,
|
_cogl_material_foreach_child (material,
|
||||||
reparent_strong_children_cb,
|
reparent_strong_children_cb,
|
||||||
new_authority);
|
new_authority);
|
||||||
|
|
||||||
|
/* The children will keep the new authority alive so drop the
|
||||||
|
* reference we got when copying... */
|
||||||
|
cogl_object_unref (new_authority);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* At this point we know we have a material with no strong
|
/* At this point we know we have a material with no strong
|
||||||
|
Loading…
Reference in New Issue
Block a user