summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-08-16 08:45:16 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-08-16 08:46:55 +0200
commit2193c4de83acfc3268ccca7b54b00543307e0baa (patch)
treed46d58a9964cdb3d05845d800005a5bbe293bf19 /src/mesa
parenta6d4dddb38e2342a6f80d7a241f23900b8b4c633 (diff)
i915tex: Unreference texture buffers on context destruction.
Not doing this could cause the buffers to leak under some circumstances.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_vtbl.c10
-rw-r--r--src/mesa/drivers/dri/i915tex/i915_vtbl.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
index a3db6c0c0c..b2a1ba0ce3 100644
--- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -524,6 +524,16 @@ i830_emit_state(struct intel_context *intel)
static void
i830_destroy_context(struct intel_context *intel)
{
+ GLuint i;
+ struct i830_context *i830 = i830_context(&intel->ctx);
+
+ for (i = 0; i < I830_TEX_UNITS; i++) {
+ if (i830->state.tex_buffer[i] != NULL) {
+ driBOUnReference(i830->state.tex_buffer[i]);
+ i830->state.tex_buffer[i] = NULL;
+ }
+ }
+
_tnl_free_vertices(&intel->ctx);
}
diff --git a/src/mesa/drivers/dri/i915tex/i915_vtbl.c b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
index ff99721769..1d651a40d7 100644
--- a/src/mesa/drivers/dri/i915tex/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
@@ -440,6 +440,16 @@ i915_emit_state(struct intel_context *intel)
static void
i915_destroy_context(struct intel_context *intel)
{
+ GLuint i;
+ struct i915_context *i915 = i915_context(&intel->ctx);
+
+ for (i = 0; i < I915_TEX_UNITS; i++) {
+ if (i915->state.tex_buffer[i] != NULL) {
+ driBOUnReference(i915->state.tex_buffer[i]);
+ i915->state.tex_buffer[i] = NULL;
+ }
+ }
+
_tnl_free_vertices(&intel->ctx);
}