From 3a5d260cb1d2602b9fc32392f18538d0a6ff41c2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 12 Dec 2008 18:34:49 +0000 Subject: gallium: fix refcount bug introduced in eb20e2984 --- src/mesa/state_tracker/st_draw.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa/state_tracker/st_draw.c') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 3229e932484..e78d98f1e91 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -670,12 +670,13 @@ st_draw_vbo(GLcontext *ctx, } /* unreference buffers (frees wrapped user-space buffer objects) */ + for (attr = 0; attr < num_vbuffers; attr++) { + pipe_buffer_reference(pipe->screen, &vbuffer[attr].buffer, NULL); + assert(!vbuffer[attr].buffer); + } + if (userSpace) { - for (attr = 0; attr < num_vbuffers; attr++) { - pipe_buffer_reference(pipe->screen, &vbuffer[attr].buffer, NULL); - assert(!vbuffer[attr].buffer); - } pipe->set_vertex_buffers(pipe, 0, NULL); } } -- cgit v1.2.3