mesa: modified _mesa_align_free() to accept NULL pointer
So that it acts like ordinary free(). This lets us remove a bunch of if statements where the function is called. v2: - Avoiding compile error on MSVC and possible warnings on other compilers. - Added comment regards passing NULL pointer being safe. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:

committed by
Brian Paul

parent
267679be84
commit
f0cc59d68a
@@ -546,10 +546,8 @@ void _tnl_free_vertices( struct gl_context *ctx )
|
||||
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
|
||||
struct tnl_clipspace_fastpath *fp, *tmp;
|
||||
|
||||
if (vtx->vertex_buf) {
|
||||
_mesa_align_free(vtx->vertex_buf);
|
||||
vtx->vertex_buf = NULL;
|
||||
}
|
||||
_mesa_align_free(vtx->vertex_buf);
|
||||
vtx->vertex_buf = NULL;
|
||||
|
||||
for (fp = vtx->fastpath ; fp ; fp = tmp) {
|
||||
tmp = fp->next;
|
||||
|
Reference in New Issue
Block a user