Destroy the GL context after driDestroyTextureHeap, because the driver's

DestroyTexObj has a dependence on the glCtx and may segfault otherwise.
This commit is contained in:
Eric Anholt 2006-04-09 17:48:28 +00:00
parent 83a43aca23
commit 8c3d15ce28
3 changed files with 12 additions and 12 deletions

View file

@ -296,10 +296,6 @@ void r128DestroyContext( __DRIcontextPrivate *driContextPriv )
_ac_DestroyContext( rmesa->glCtx );
_swrast_DestroyContext( rmesa->glCtx );
/* free the Mesa context */
rmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context(rmesa->glCtx);
if ( release_texture_heaps ) {
/* This share group is about to go away, free our private
* texture object data.
@ -314,6 +310,10 @@ void r128DestroyContext( __DRIcontextPrivate *driContextPriv )
assert( is_empty_list( & rmesa->swapped ) );
}
/* free the Mesa context */
rmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context(rmesa->glCtx);
/* free the option cache */
driDestroyOptionCache (&rmesa->optionCache);

View file

@ -590,10 +590,6 @@ void r200DestroyContext( __DRIcontextPrivate *driContextPriv )
r200VtxfmtDestroy( rmesa->glCtx );
}
/* free the Mesa context */
rmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context( rmesa->glCtx );
if (rmesa->state.scissor.pClipRects) {
FREE(rmesa->state.scissor.pClipRects);
rmesa->state.scissor.pClipRects = NULL;
@ -613,6 +609,10 @@ void r200DestroyContext( __DRIcontextPrivate *driContextPriv )
assert( is_empty_list( & rmesa->swapped ) );
}
/* free the Mesa context */
rmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context( rmesa->glCtx );
/* free the option cache */
driDestroyOptionCache (&rmesa->optionCache);

View file

@ -521,10 +521,6 @@ void radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
radeonVtxfmtDestroy( rmesa->glCtx );
}
/* free the Mesa context */
rmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context( rmesa->glCtx );
_mesa_vector4f_free( &rmesa->tcl.ObjClean );
if (rmesa->state.scissor.pClipRects) {
@ -546,6 +542,10 @@ void radeonDestroyContext( __DRIcontextPrivate *driContextPriv )
assert( is_empty_list( & rmesa->swapped ) );
}
/* free the Mesa context */
rmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context( rmesa->glCtx );
/* free the option cache */
driDestroyOptionCache (&rmesa->optionCache);