From: Keith Whitwell Date: Fri, 12 Dec 2008 18:34:49 +0000 (+0000) Subject: gallium: fix refcount bug introduced in eb20e2984 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3a5d260cb1d2602b9fc32392f18538d0a6ff41c2;p=mesa.git gallium: fix refcount bug introduced in eb20e2984 --- 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); } }