From 971b5cfae14ce584b12f9c9c8360fe60dcff7dbc Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 7 Aug 2012 15:25:21 +0100 Subject: [PATCH] primitive: Don't leak indices If a CoglPrimitive is associated with a set of indices then we must unref those indices when freeing the primitive to avoid a leak. Reviewed-by: Neil Roberts (cherry picked from commit 45cac786b55c953e44f98b864add952b9e398b13) --- cogl/cogl-primitive.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cogl/cogl-primitive.c b/cogl/cogl-primitive.c index db80ca218..6f3a40e2e 100644 --- a/cogl/cogl-primitive.c +++ b/cogl/cogl-primitive.c @@ -380,6 +380,9 @@ _cogl_primitive_free (CoglPrimitive *primitive) g_slice_free1 (sizeof (CoglAttribute *) * primitive->n_attributes, primitive->attributes); + if (primitive->indices) + cogl_object_unref (primitive->indices); + g_slice_free1 (sizeof (CoglPrimitive) + sizeof (CoglAttribute *) * (primitive->n_embedded_attributes - 1), primitive);