summaryrefslogtreecommitdiffstats
path: root/src/glx/x11/indirect_vertex_array.c
diff options
context:
space:
mode:
authorKristof Ralovich <[email protected]>2008-08-20 15:18:38 -0600
committerBrian Paul <[email protected]>2008-08-20 15:33:03 -0600
commite2060348630b59a446bac7f734fdde40033093ab (patch)
tree2920967978965236aa4e4f667513d70fe72ca5a8 /src/glx/x11/indirect_vertex_array.c
parentfb36a54a1c327efc6602ff104b097359f9823931 (diff)
glx: free vertex array state when context is destroyed
Diffstat (limited to 'src/glx/x11/indirect_vertex_array.c')
-rw-r--r--src/glx/x11/indirect_vertex_array.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/glx/x11/indirect_vertex_array.c b/src/glx/x11/indirect_vertex_array.c
index 15e3ece1487..c7a20e2bc56 100644
--- a/src/glx/x11/indirect_vertex_array.c
+++ b/src/glx/x11/indirect_vertex_array.c
@@ -101,6 +101,31 @@ const GLuint __glXTypeSize_table[16] = {
};
+/**
+ * Free the per-context array state that was allocated with
+ * __glXInitVertexArrayState().
+ */
+void
+__glXFreeVertexArrayState( __GLXcontext * gc )
+{
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ struct array_state_vector* arrays = state->array_state;
+
+ if (arrays) {
+ if (arrays->stack) {
+ free(arrays->stack);
+ arrays->stack = NULL;
+ }
+ if (arrays->arrays) {
+ free(arrays->arrays);
+ arrays->arrays = NULL;
+ }
+ free(arrays);
+ arrays = NULL;
+ state->array_state = NULL;
+ }
+}
+
/**
* Initialize vertex array state of a GLX context.