From a57e6e7214f217bc9368b702b1ee9610855d303d 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. --- cogl/cogl-primitives.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c index 23fccf4af..ad388120b 100644 --- a/cogl/cogl-primitives.c +++ b/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); }