diff options
author | Brian <[email protected]> | 2007-08-13 14:53:27 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-08-13 14:53:27 -0600 |
commit | faa14a9ded2ddb784302b4634f0ca40c51ec1c4b (patch) | |
tree | bccc20bea67a50ad4d77e0a6587596e848930865 /src | |
parent | b7693ee5594e13f56a83230ce6ca61f23f1b5343 (diff) |
check for ctx==NULL in st_renderbuffer_delete()
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index bb588d10ea2..3048765114d 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -118,15 +118,20 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, 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); } |