<div dir="ltr">Hi,<div>I am either using pipelines incorrectly or found a problem in cogl pipeline layer code.  Are they really supposed to be treated as immutable after you've rendered with them?  I just read that in check-in comments and that is not how I programmed my code.  In this problem case I'm not making a change after rendering so the immutability is moot.  But changing them like adding/removing a layer does seem to work with the same pipeline.</div><div><br></div><div>The following occurs ONLY on the first Actor I create with a new or copied pipeline.  All additional actors with a new or copied pipeline do not cause a leak.  </div><div><br></div><div>First case: I'm creating a pipeline, setting a texture on layer 0, drawing with it, then later unreffing the pipeline.  It seems that the pipeline would be freed but the texture did not because a pipeline layer held a reference to it.  I inserted a cogl_pipeline_set_layer_texture(pipeline, 0, NULL) in my code just before unreffing the pipeline and voila the texture was freed.</div><div><br></div><div>In another version of the code I copy a pipeline, setting a texture on layer 0, drawing with it, then later unreffing the pipeline. It  seems again that the pipeline would be freed but the texture did not because a pipeline layer held a reference to it.  I inserted a cogl_pipeline_set_layer_texture(pipeline, 0, NULL) in my code just before unreffing the pipeline, but in this case the texture is not unreffed and freed.  In the routine _cogl_pipeline_set_layer_texture_data() for some reason for just the first actor and pipeline copy it takes the (new != layer) condition and doesn't unref the texture which is done in the else clause (/* If the original layer we found is currently the authority on ...) for all subsequent actors / pipeline copies.</div><div><br></div><div>Unfortunately if you have for the first actor and pipeline a 1024x1024 texture and activate the atlas then you get a 2048x2048 atlas (16Mb of GPU RAM) that doesn't free up when the actor and pipeline copy is destroyed.<br></div><div><br></div><div>Could anyone help me out here?</div><div><br></div><div>Thanks,</div><div><br></div><div>Reza</div></div>