From 4e56eec36620907a8ccba7ae41965ccacd7252bb Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 15 Nov 2010 01:32:42 -0500 Subject: [PATCH] Free state at the end of a journal flush At the end of flushing the journal, we need to free the vertex attributes and vertex array. http://bugzilla.clutter-project.org/show_bug.cgi?id=2423 --- cogl/cogl-journal.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c index 9d8ea572e..9f9cfebbe 100644 --- a/cogl/cogl-journal.c +++ b/cogl/cogl-journal.c @@ -696,7 +696,6 @@ _cogl_journal_flush (void) state.vertex_array = upload_vertices (ctx->logged_vertices, &state); state.attributes = ctx->journal_flush_attributes_array; - g_array_set_size (ctx->journal_flush_attributes_array, 0); framebuffer = _cogl_get_framebuffer (); modelview_stack = _cogl_framebuffer_get_modelview_stack (framebuffer); @@ -732,6 +731,13 @@ _cogl_journal_flush (void) _cogl_journal_flush_clip_stacks_and_entries, /* callback */ &state); /* data */ + for (i = 0; i < state.attributes->len; i++) + cogl_object_unref (g_array_index (state.attributes, + CoglVertexAttribute *, i)); + g_array_set_size (state.attributes, 0); + + cogl_object_unref (state.vertex_array); + for (i = 0; i < ctx->journal->len; i++) { CoglJournalEntry *entry =