static void
st_renderbuffer_delete(struct gl_renderbuffer *rb)
{
- GET_CURRENT_CONTEXT(ctx);
- struct pipe_context *pipe = ctx->st->pipe;
struct st_renderbuffer *strb = st_renderbuffer(rb);
- ASSERT(strb);
- if (strb && strb->surface) {
- if (strb->surface->region) {
- pipe->region_release(pipe, &strb->surface->region);
+ GET_CURRENT_CONTEXT(ctx);
+ if (ctx) {
+ struct pipe_context *pipe = ctx->st->pipe;
+ ASSERT(strb);
+ if (strb && strb->surface) {
+ if (strb->surface->region) {
+ pipe->region_release(pipe, &strb->surface->region);
+ }
+ free(strb->surface);
}
- free(strb->surface);
+ }
+ else {
+ _mesa_warning(NULL, "st_renderbuffer_delete() called, but no current context");
}
free(strb);
}