From: Luca Barbieri Date: Tue, 23 Feb 2010 16:50:15 +0000 (-0800) Subject: pipebuffer: avoid assert due to increasing a zeroed refcnt X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f4f87893b4d3555204a1a66d108f8f9185e3d14;p=mesa.git 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 --- diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 53bc019a204..86f9266c95f 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; }