diff options
author | José Fonseca <[email protected]> | 2010-02-01 21:33:04 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-02-09 11:52:08 +0000 |
commit | 829d9bb7334ffea0d5d0c4076dd75c41525fae0c (patch) | |
tree | dd624d952350c887bc2b3128f860512b5523d69d | |
parent | 05ac187f305bb653d569b5c07446ec0f4cd7ff08 (diff) |
mesa: Ensure object refcount is null when destroying the buffer.
Lets see if this is not too pedantic. Obj pointers are never exposed to
GL apps so it should be possible to get this right.
Furthermore apps with GL widgets and test suits create and destroy many
contexts and objects, so bad reference counting is not really an option.
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 3ff589034ae..f1b4f11c050 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -75,6 +75,8 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj) { struct st_buffer_object *st_obj = st_buffer_object(obj); + assert(obj->RefCount == 0); + if (st_obj->buffer) pipe_buffer_reference(&st_obj->buffer, NULL); |