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:
Robert Bragg 2010-07-03 18:44:47 +01:00
parent 70925a3194
commit cf8e88768f

View File

@ -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