Mesa (master): pipebuffer: avoid assert due to increasing a zeroed refcnt
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Tue Feb 23 19:50:30 UTC 2010
Module: Mesa
Branch: master
Commit: 9f4f87893b4d3555204a1a66d108f8f9185e3d14
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f4f87893b4d3555204a1a66d108f8f9185e3d14
Author: Luca Barbieri <luca at luca-barbieri.com>
Date: Tue Feb 23 08:50:15 2010 -0800
pipebuffer: avoid assert due to increasing a zeroed refcnt
The cache manager stores buffers with a reference count that dropped to 0.
pipe_reference asserts in this case on debug builds,
so use pipe_reference_init instead.
Signed-off-by: José Fonseca <jfonseca at vmware.com>
---
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
index 53bc019..86f9266 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
@@ -294,7 +294,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
LIST_DEL(&buf->head);
pipe_mutex_unlock(mgr->mutex);
/* Increase refcount */
- pipe_reference(NULL, &buf->base.base.reference);
+ pipe_reference_init(&buf->base.base.reference, 1);
return &buf->base;
}
More information about the mesa-commit
mailing list