summaryrefslogtreecommitdiff
path: root/cogl/cogl-primitives.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2010-11-25 20:12:36 +0000
committerRobert Bragg <robert@linux.intel.com>2010-11-26 14:33:50 +0000
commita57e6e7214f217bc9368b702b1ee9610855d303d (patch)
tree9d344bdd954075908413c8b5bd238b0f2230f6e0 /cogl/cogl-primitives.c
parentc64e0103afdf5d4f79137638657cfdacbddd34a8 (diff)
downloadcogl-a57e6e7214f217bc9368b702b1ee9610855d303d.tar.gz
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.
Diffstat (limited to 'cogl/cogl-primitives.c')
-rw-r--r--cogl/cogl-primitives.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index 23fccf4a..ad388120 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);
}