From: Chia-I Wu Date: Tue, 4 Jun 2013 08:39:07 +0000 (+0800) Subject: u_vbuf: fix index buffer leak X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97d641eb229e48cacc448eefb583381a27bd8af1;p=mesa.git u_vbuf: fix index buffer leak Signed-off-by: Chia-I Wu Reviewed-by: Marek Olšák --- diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c index 244b04d2a42..5936f74a039 100644 --- a/src/gallium/auxiliary/util/u_vbuf.c +++ b/src/gallium/auxiliary/util/u_vbuf.c @@ -307,6 +307,9 @@ void u_vbuf_destroy(struct u_vbuf *mgr) unsigned num_vb = screen->get_shader_param(screen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_MAX_INPUTS); + mgr->pipe->set_index_buffer(mgr->pipe, NULL); + pipe_resource_reference(&mgr->index_buffer.buffer, NULL); + mgr->pipe->set_vertex_buffers(mgr->pipe, 0, num_vb, NULL); for (i = 0; i < PIPE_MAX_ATTRIBS; i++) {