summaryrefslogtreecommitdiff
path: root/src/glx/x11/indirect_vertex_array.c
diff options
context:
space:
mode:
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 15e3ece148..c7a20e2bc5 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.