summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_aaline.c7
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_pstipple.c6
-rw-r--r--src/gallium/auxiliary/util/u_handle_table.c18
4 files changed, 22 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/draw/draw_aaline.c b/src/gallium/auxiliary/draw/draw_aaline.c
index b4fa6bd967..6742f7f4b9 100644
--- a/src/gallium/auxiliary/draw/draw_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_aaline.c
@@ -665,7 +665,14 @@ aaline_reset_stipple_counter(struct draw_stage *stage)
static void
aaline_destroy(struct draw_stage *stage)
{
+ struct aaline_stage *aaline = aaline_stage(stage);
+
+ aaline->pipe->delete_sampler_state(aaline->pipe, aaline->sampler_cso);
+
+ pipe_texture_release(&aaline->texture);
+
draw_free_temp_verts( stage );
+
FREE( stage );
}
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 4cca965ac1..41da93cdf8 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -113,6 +113,8 @@ void draw_destroy( struct draw_context *draw )
draw->pipeline.aaline->destroy( draw->pipeline.aaline );
if (draw->pipeline.aapoint)
draw->pipeline.aapoint->destroy( draw->pipeline.aapoint );
+ if (draw->pipeline.pstipple)
+ draw->pipeline.pstipple->destroy( draw->pipeline.pstipple );
if (draw->pipeline.rasterize)
draw->pipeline.rasterize->destroy( draw->pipeline.rasterize );
tgsi_exec_machine_free_data(&draw->machine);
diff --git a/src/gallium/auxiliary/draw/draw_pstipple.c b/src/gallium/auxiliary/draw/draw_pstipple.c
index 9d154a6838..bd8d3a76ae 100644
--- a/src/gallium/auxiliary/draw/draw_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pstipple.c
@@ -534,6 +534,12 @@ pstip_reset_stipple_counter(struct draw_stage *stage)
static void
pstip_destroy(struct draw_stage *stage)
{
+ struct pstip_stage *pstip = pstip_stage(stage);
+
+ pstip->pipe->delete_sampler_state(pstip->pipe, pstip->sampler_cso);
+
+ pipe_texture_release(&pstip->texture);
+
draw_free_temp_verts( stage );
FREE( stage );
}
diff --git a/src/gallium/auxiliary/util/u_handle_table.c b/src/gallium/auxiliary/util/u_handle_table.c
index 5a731a6b96..2176a00959 100644
--- a/src/gallium/auxiliary/util/u_handle_table.c
+++ b/src/gallium/auxiliary/util/u_handle_table.c
@@ -170,7 +170,7 @@ handle_table_set(struct handle_table *ht,
unsigned index;
assert(ht);
- assert(handle > 0);
+ assert(handle);
if(!handle)
return 0;
@@ -184,7 +184,9 @@ handle_table_set(struct handle_table *ht,
if(!handle_table_resize(ht, index))
return 0;
- assert(!ht->objects[index]);
+ if(ht->objects[index] && ht->destroy)
+ ht->destroy(ht->objects[index]);
+
ht->objects[index] = object;
return handle;
@@ -198,13 +200,11 @@ handle_table_get(struct handle_table *ht,
void *object;
assert(ht);
- assert(handle > 0);
- assert(handle <= ht->size);
+ assert(handle);
if(!handle || handle > ht->size)
return NULL;
object = ht->objects[handle - 1];
- assert(object);
return object;
}
@@ -218,18 +218,14 @@ handle_table_remove(struct handle_table *ht,
unsigned index;
assert(ht);
- assert(handle > 0);
- assert(handle <= ht->size);
+ assert(handle);
if(!handle || handle > ht->size)
return;
index = handle - 1;
object = ht->objects[index];
- if(!object) {
- /* XXX: this warning may be noisy for legitimate use -- remove later */
- debug_warning("removing empty handle");
+ if(!object)
return;
- }
if(ht->destroy)
ht->destroy(object);