diff options
author | Siavash Eliasi <[email protected]> | 2013-12-03 21:50:00 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-12-04 07:31:27 -0700 |
commit | f0cc59d68a9f5231e8e2111393a1834858820735 (patch) | |
tree | e8261356dc2405630122615badac6777ae760c81 /src/mesa/math | |
parent | 267679be84de5bc9d2bd0fccb1712bc5cddb6be7 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/mesa/math')
-rw-r--r-- | src/mesa/math/m_matrix.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 290231527d5..274f969d2e4 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1488,14 +1488,11 @@ _math_matrix_ctr( GLmatrix *m ) void _math_matrix_dtr( GLmatrix *m ) { - if (m->m) { - _mesa_align_free( m->m ); - m->m = NULL; - } - if (m->inv) { - _mesa_align_free( m->inv ); - m->inv = NULL; - } + _mesa_align_free( m->m ); + m->m = NULL; + + _mesa_align_free( m->inv ); + m->inv = NULL; } /*@}*/ |