summaryrefslogtreecommitdiff
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index ac70e5a22e..ea3328a047 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -287,7 +287,10 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
if (deleteFlag) {
GET_CURRENT_CONTEXT(ctx);
- ctx->Driver.DeleteTexture(ctx, oldTex);
+ if (ctx)
+ ctx->Driver.DeleteTexture(ctx, oldTex);
+ else
+ _mesa_problem(NULL, "Unable to delete texture, no context");
}
*ptr = NULL;