primitives: avoid leaking polygon override materials
authorRobert Bragg <robert@linux.intel.com>
Thu, 25 Nov 2010 20:12:36 +0000 (20:12 +0000)
committerRobert Bragg <robert@linux.intel.com>
Fri, 26 Nov 2010 14:33:50 +0000 (14:33 +0000)
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

index 23fccf4..ad38812 100644 (file)
@@ -1164,5 +1164,8 @@ cogl_polygon (const CoglTextureVertex *vertices,
                                      attributes);
 
   cogl_pop_source ();
+
+  if (pipeline != validate_state.original_pipeline)
+    cogl_object_unref (pipeline);
 }