diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fbobject.c | 2 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 2 | ||||
-rw-r--r-- | src/mesa/main/renderbuffer.c | 8 | ||||
-rw-r--r-- | src/mesa/main/renderbuffer.h | 2 | ||||
-rw-r--r-- | src/mesa/main/shared.c | 3 |
5 files changed, 11 insertions, 6 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 2e2fc2ca314..9eec61de695 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -78,7 +78,7 @@ static struct gl_framebuffer IncompleteFramebuffer; static void -delete_dummy_renderbuffer(struct gl_renderbuffer *rb) +delete_dummy_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb) { /* no op */ } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f34b3421b07..5bfae69c83c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2605,7 +2605,7 @@ struct gl_renderbuffer gl_format Format; /**< The actual renderbuffer memory format */ /** Delete this renderbuffer */ - void (*Delete)(struct gl_renderbuffer *rb); + void (*Delete)(struct gl_context *ctx, struct gl_renderbuffer *rb); /** Allocate new storage for this renderbuffer */ GLboolean (*AllocStorage)(struct gl_context *ctx, diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 26f53d1009d..2f284432994 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -80,7 +80,7 @@ _mesa_new_renderbuffer(struct gl_context *ctx, GLuint name) * free the object in the end. */ void -_mesa_delete_renderbuffer(struct gl_renderbuffer *rb) +_mesa_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb) { _glthread_DESTROY_MUTEX(rb->Mutex); free(rb); @@ -159,7 +159,11 @@ _mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr, _glthread_UNLOCK_MUTEX(oldRb->Mutex); if (deleteFlag) { - oldRb->Delete(oldRb); + GET_CURRENT_CONTEXT(ctx); + if (ctx) + oldRb->Delete(ctx, oldRb); + else + _mesa_problem(NULL, "Unable to delete renderbuffer, no context"); } *ptr = NULL; diff --git a/src/mesa/main/renderbuffer.h b/src/mesa/main/renderbuffer.h index 0934d85df04..5495ae15052 100644 --- a/src/mesa/main/renderbuffer.h +++ b/src/mesa/main/renderbuffer.h @@ -40,7 +40,7 @@ extern struct gl_renderbuffer * _mesa_new_renderbuffer(struct gl_context *ctx, GLuint name); extern void -_mesa_delete_renderbuffer(struct gl_renderbuffer *rb); +_mesa_delete_renderbuffer(struct gl_context *ctx, struct gl_renderbuffer *rb); extern void _mesa_add_renderbuffer(struct gl_framebuffer *fb, diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index ba82628f3eb..eaf9f8de1b1 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -253,10 +253,11 @@ delete_framebuffer_cb(GLuint id, void *data, void *userData) static void delete_renderbuffer_cb(GLuint id, void *data, void *userData) { + struct gl_context *ctx = (struct gl_context *) userData; struct gl_renderbuffer *rb = (struct gl_renderbuffer *) data; rb->RefCount = 0; /* see comment for FBOs above */ if (rb->Delete) - rb->Delete(rb); + rb->Delete(ctx, rb); } |