summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-08-16 08:45:16 +0200
committerMichel Dänzer <[email protected]>2007-08-16 08:45:16 +0200
commit09dd25b5d18469a5e4de6f60afbedb55821b23d5 (patch)
tree7cdbc821a05d8bc12f4ea963fdf87a36ffc0cfe5 /src
parentc48efb1dbe9718733b6d7e35acc244ca893e954b (diff)
i915tex: Unreference texture buffers on context destruction.
Not doing this could cause the buffers to leak under some circumstances.
Diffstat (limited to 'src')
-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 e432648ada0..5555b74668d 100644
--- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -519,6 +519,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 ad333b490b7..e911fc40084 100644
--- a/src/mesa/drivers/dri/i915tex/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i915_vtbl.c
@@ -430,6 +430,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);
}