summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-01-06 17:13:37 +0000
committerKeith Whitwell <[email protected]>2010-01-06 17:13:37 +0000
commitb08583da468ee186b43ea678f8d33fb7df3ab372 (patch)
tree7c770b29a513c0e82881315159cc93f4d3d0ef10 /src/gallium/drivers
parent601969c58729e26db6a33645a6a9ddb0b6ea2b92 (diff)
llvmpipe: fix double free
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.c5
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c3
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.h2
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_context.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 0457ccc8a94..696a9d5f6a8 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -53,12 +53,11 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
uint i;
+ /* This will also destroy llvmpipe->setup:
+ */
if (llvmpipe->draw)
draw_destroy( llvmpipe->draw );
- if (llvmpipe->setup)
- lp_setup_destroy( llvmpipe->setup );
-
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
pipe_surface_reference(&llvmpipe->framebuffer.cbufs[i], NULL);
}
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index e2b21aed473..1eb944a0de7 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -571,7 +571,8 @@ lp_setup_update_state( struct setup_context *setup )
-
+/* Only caller is lp_setup_vbuf_destroy()
+ */
void
lp_setup_destroy( struct setup_context *setup )
{
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h
index a6120fcbe40..bf12cb85271 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup.h
@@ -128,7 +128,5 @@ void
lp_setup_set_vertex_info( struct setup_context *setup,
struct vertex_info *info );
-void
-lp_setup_destroy( struct setup_context *setup );
#endif
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h
index d2278a46e66..a1808fcd4c0 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h
@@ -141,4 +141,6 @@ void lp_setup_init_vbuf(struct setup_context *setup);
void lp_setup_update_state( struct setup_context *setup );
+void lp_setup_destroy( struct setup_context *setup );
+
#endif