summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorSean D'Epagnier <sean@depagnier.com>2007-04-23 21:17:30 -0700
committerSean D'Epagnier <sean@depagnier.com>2007-04-23 21:17:30 -0700
commit47ad443c55cf07b32bac04b97066cfd3c2aa3554 (patch)
tree37e92ab0a2b7d67225ea5ac29ee326e34ef79872 /src/mesa/drivers
parent3db3dc58bcc361637d7473ee4b7c4e3b036c283c (diff)
Added proper cleanup code
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/fbdev/glfbdev.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index 0ece3864d0..6c6511b7e5 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -682,9 +682,16 @@ glFBDevDestroyBuffer( GLFBDevBufferPtr buffer )
if (buffer == curDraw || buffer == curRead) {
glFBDevMakeCurrent( NULL, NULL, NULL);
}
+#if 0
/* free the software depth, stencil, accum buffers */
_mesa_free_framebuffer_data(&buffer->glframebuffer);
_mesa_free(buffer);
+#else
+ {
+ struct gl_framebuffer *fb = &buffer->glframebuffer;
+ _mesa_unreference_framebuffer(&fb);
+ }
+#endif
}
}
@@ -799,6 +806,13 @@ glFBDevDestroyContext( GLFBDevContextPtr context )
GLFBDevContextPtr fbdevctx = glFBDevGetCurrentContext();
if (context) {
+ GLcontext *mesaCtx = &context->glcontext;
+
+ _swsetup_DestroyContext( mesaCtx );
+ _swrast_DestroyContext( mesaCtx );
+ _tnl_DestroyContext( mesaCtx );
+ _vbo_DestroyContext( mesaCtx );
+
if (fbdevctx == context) {
/* destroying current context */
_mesa_make_current(NULL, NULL, NULL);