if (r300->rmm->u_list[i].ptr == NULL) {
continue;
}
-
- assert(r300->rmm->u_list[i].pending);
+
+ /* check whether this buffer is still in use */
+ if (!r300->rmm->u_list[i].pending) {
+ continue;
+ }
+
assert(r300->rmm->u_list[i].h_pending == 0);
tries = 0;
void radeonCleanupContext(radeonContextPtr radeon)
{
/* free the Mesa context */
- radeon->glCtx->DriverCtx = NULL;
_mesa_destroy_context(radeon->glCtx);
+ /* the above call might result in calls to functions that depend on
+ * the DriverCtx.
+ */
+ radeon->glCtx->DriverCtx = NULL;
+
if (radeon->state.scissor.pClipRects) {
FREE(radeon->state.scissor.pClipRects);
radeon->state.scissor.pClipRects = 0;
#endif
#if FEATURE_ARB_vertex_buffer_object
+ /* Free vertex buffer objects */
+ while (1) {
+ GLuint name = _mesa_HashFirstEntry(ss->BufferObjects);
+ if (name) {
+ struct gl_buffer_object *bufObj = (struct gl_buffer_object *)
+ _mesa_HashLookup(ss->BufferObjects, name);
+ ASSERT(bufObj);
+ ctx->Driver.DeleteBuffer(ctx, bufObj);
+ _mesa_HashRemove(ss->BufferObjects, name);
+ }
+ else {
+ break;
+ }
+ }
_mesa_DeleteHashTable(ss->BufferObjects);
#endif