ilo: plug a potential index buffer leak
authorChia-I Wu <olvaffe@gmail.com>
Thu, 27 Jun 2013 03:44:27 +0000 (11:44 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Thu, 27 Jun 2013 03:46:58 +0000 (11:46 +0800)
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

index 59d3c3612a008f5f0460f98e521a590f9fa1c544..17d12441945bdd0a5fc54775fbc017e7b94808b1 100644 (file)
@@ -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);