summaryrefslogtreecommitdiff
path: root/src/mesa/vbo/vbo_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo/vbo_context.c')
-rw-r--r--src/mesa/vbo/vbo_context.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index 691bf5b450..bbf745b0c6 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -244,12 +244,14 @@ void _vbo_DestroyContext( GLcontext *ctx )
ctx->aelt_context = NULL;
}
- vbo_exec_destroy(ctx);
+ if (vbo_context(ctx)) {
+ vbo_exec_destroy(ctx);
#if FEATURE_dlist
- vbo_save_destroy(ctx);
+ vbo_save_destroy(ctx);
#endif
- FREE(vbo_context(ctx));
- ctx->swtnl_im = NULL;
+ FREE(vbo_context(ctx));
+ ctx->swtnl_im = NULL;
+ }
}