Mesa (master): util: fix mutex leaks in mempool

Marek Olšák mareko at kemper.freedesktop.org
Mon Jul 26 12:53:59 UTC 2010


Module: Mesa
Branch: master
Commit: d26fb6916931f10e029429ecbf46e86484e7e956
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d26fb6916931f10e029429ecbf46e86484e7e956

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon Jul 26 14:53:06 2010 +0200

util: fix mutex leaks in mempool

---

 src/gallium/auxiliary/util/u_mempool.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_mempool.c b/src/gallium/auxiliary/util/u_mempool.c
index 84e2a34..6b1a72a 100644
--- a/src/gallium/auxiliary/util/u_mempool.c
+++ b/src/gallium/auxiliary/util/u_mempool.c
@@ -126,7 +126,6 @@ void util_mempool_set_thread_safety(struct util_mempool *pool,
    pool->threading = threading;
 
    if (threading) {
-      pipe_mutex_init(pool->mutex);
       pool->malloc = util_mempool_malloc_mt;
       pool->free = util_mempool_free_mt;
    } else {
@@ -152,6 +151,8 @@ void util_mempool_create(struct util_mempool *pool,
 
    make_empty_list(&pool->list);
 
+   pipe_mutex_init(pool->mutex);
+
    util_mempool_set_thread_safety(pool, threading);
 }
 




More information about the mesa-commit mailing list