Commit
6e8d04a caused a leak by allocating ctx->Debug but never freeing it.
Release the memory in _mesa_free_errors_data when destroying a context.
Use FREE to match CALLOC_STRUCT from _mesa_get_debug_state.
Reviewed-by: Brian Paul <brianp@vmware.com>
/**
* Loop through debug group stack tearing down states for
- * filtering debug messages.
+ * filtering debug messages. Then free debug output state.
*/
void
_mesa_free_errors_data(struct gl_context *ctx)
for (i = 0; i <= ctx->Debug->GroupStackDepth; i++) {
free_errors_data(ctx, i);
}
+ FREE(ctx->Debug);
+ /* set to NULL just in case it is used before context is completely gone. */
+ ctx->Debug = NULL;
}
}