From 58a467c9270ec325431fc963aa8a862ae69fcabf Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 25 Nov 2010 20:12:36 +0000 Subject: [PATCH] primitives: avoid leaking polygon override materials If we have to make override changes to the user's source material to handle cogl_polygon then we need to make sure we unref the override material at the end. --- clutter/cogl/cogl/cogl-primitives.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/cogl/cogl/cogl-primitives.c b/clutter/cogl/cogl/cogl-primitives.c index 23fccf4af..ad388120b 100644 --- a/clutter/cogl/cogl/cogl-primitives.c +++ b/clutter/cogl/cogl/cogl-primitives.c @@ -1164,5 +1164,8 @@ cogl_polygon (const CoglTextureVertex *vertices, attributes); cogl_pop_source (); + + if (pipeline != validate_state.original_pipeline) + cogl_object_unref (pipeline); }