Mesa (master): gallium: fix ref counting bug in pb_bufmgr

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Dec 8 10:28:44 PST 2009


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Thu Dec  3 23:20:56 2009 +0100

gallium: fix ref counting bug in pb_bufmgr

This was discovered by the pipe_reference api change.

---

 src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
index f0c88a0..7b34c8e 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
@@ -293,11 +293,8 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
    if(buf) {
       LIST_DEL(&buf->head);
       pipe_mutex_unlock(mgr->mutex);
-#if 0
-      /* XXX this didn't do anything right??? */
       /* Increase refcount */
-      pb_reference((struct pb_buffer**)&buf, &buf->base);
-#endif
+      pipe_reference(NULL, &buf->base.base.reference);
       return &buf->base;
    }
    



More information about the mesa-commit mailing list