Mesa (master): ilo: plug a potential index buffer leak

Chia-I Wu olv at kemper.freedesktop.org
Thu Jun 27 03:49:11 UTC 2013


Module: Mesa
Branch: master
Commit: 9f3cfe6aafc210906be85de065afff7503ef240b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f3cfe6aafc210906be85de065afff7503ef240b

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Thu Jun 27 11:44:27 2013 +0800

ilo: plug a potential index buffer leak

This is harmless since st_context and u_vbuf both set index buffer to NULL
before destroying themselves.  But we do not want to rely on that behavior.

---

 src/gallium/drivers/ilo/ilo_state.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c
index 59d3c36..17d1244 100644
--- a/src/gallium/drivers/ilo/ilo_state.c
+++ b/src/gallium/drivers/ilo/ilo_state.c
@@ -1248,6 +1248,7 @@ ilo_cleanup_states(struct ilo_context *ilo)
    }
 
    pipe_resource_reference(&ilo->ib.state.buffer, NULL);
+   pipe_resource_reference(&ilo->ib.resource, NULL);
 
    for (i = 0; i < ilo->so.count; i++)
       pipe_so_target_reference(&ilo->so.states[i], NULL);




More information about the mesa-commit mailing list