[cogl/cogl-1.12] primitive: Don't leak indices
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.12] primitive: Don't leak indices
- Date: Mon, 3 Sep 2012 18:19:13 +0000 (UTC)
commit 971b5cfae14ce584b12f9c9c8360fe60dcff7dbc
Author: Robert Bragg <robert linux intel com>
Date: Tue Aug 7 15:25:21 2012 +0100
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 <neil linux intel com>
(cherry picked from commit 45cac786b55c953e44f98b864add952b9e398b13)
cogl/cogl-primitive.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-primitive.c b/cogl/cogl-primitive.c
index db80ca2..6f3a40e 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]