st/mesa: use _mesa_delete_buffer_object
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 6 Jan 2016 02:49:11 +0000 (21:49 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 7 Jan 2016 22:06:58 +0000 (17:06 -0500)
This is more future-proof than the current code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
src/mesa/state_tracker/st_cb_bufferobjects.c

index 5d20b26d26e9aa258f36c5d3a8fdbac92899d982..c75f4765b949421fd4fbb5c1ffc9791a88190f3d 100644 (file)
@@ -83,9 +83,7 @@ st_bufferobj_free(struct gl_context *ctx, struct gl_buffer_object *obj)
    if (st_obj->buffer)
       pipe_resource_reference(&st_obj->buffer, NULL);
 
-   mtx_destroy(&st_obj->Base.Mutex);
-   free(st_obj->Base.Label);
-   free(st_obj);
+   _mesa_delete_buffer_object(ctx, obj);
 }