aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPauli Nieminen <[email protected]>2009-08-04 14:42:20 +0300
committerAlex Deucher <[email protected]>2009-08-12 15:40:14 -0400
commitb6a4f5f1d3f0a79b4502d0b30d8b259e8189b70f (patch)
tree4d46a5c548b5a84d0058191fea6289d6c03b3d5a /src
parent855374a76a6e83cc0ad4af143b74e655e7b77d5e (diff)
r200: Prevent TexGenMatrix from leaking when destroying r200 context.
Signed-off-by: Pauli Nieminen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c12
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c10
2 files changed, 17 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 9a92a320797..8cb287de268 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -500,3 +500,15 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
}
+void r200DestroyContext( __DRIcontextPrivate *driContextPriv )
+{
+ int i;
+ r200ContextPtr rmesa = (r200ContextPtr)driContextPriv->driverPrivate;
+ if (rmesa)
+ {
+ for ( i = 0 ; i < R200_MAX_TEXTURE_UNITS ; i++ ) {
+ _math_matrix_dtr( &rmesa->TexGenMatrix[i] );
+ }
+ }
+ radeonDestroyContext(driContextPriv);
+}
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 507a620e68b..89bb31ea181 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -1596,11 +1596,6 @@ static GLboolean radeonCreateContext(const __GLcontextModes * glVisual,
return r300CreateContext(glVisual, driContextPriv, sharedContextPriv);
#endif
-#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
- if (IS_R200_CLASS(screen))
- return r200CreateContext(glVisual, driContextPriv, sharedContextPriv);
-#endif
-
#if !RADEON_COMMON
(void)screen;
return r100CreateContext(glVisual, driContextPriv, sharedContextPriv);
@@ -1800,8 +1795,13 @@ getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo )
const struct __DriverAPIRec driDriverAPI = {
.InitScreen = radeonInitScreen,
.DestroyScreen = radeonDestroyScreen,
+#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
+ .CreateContext = r200CreateContext,
+ .DestroyContext = r200DestroyContext,
+#else
.CreateContext = radeonCreateContext,
.DestroyContext = radeonDestroyContext,
+#endif
.CreateBuffer = radeonCreateBuffer,
.DestroyBuffer = radeonDestroyBuffer,
.SwapBuffers = radeonSwapBuffers,