From 346d3e40a37f2229b0a9314fd8a3c2b6c4313752 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 --- clutter/cogl/cogl/cogl-journal.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clutter/cogl/cogl/cogl-journal.c b/clutter/cogl/cogl/cogl-journal.c index 9d8ea572e..9f9cfebbe 100644 --- a/clutter/cogl/cogl/cogl-journal.c +++ b/clutter/cogl/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 =