[Mesa-dev] [PATCH] intel: Fix region refcounting in intel_alloc_renderbuffer_storage

Eric Anholt eric at anholt.net
Wed Jun 15 18:16:11 PDT 2011


On Wed, 15 Jun 2011 15:54:13 -0700, Chad Versace <chad at chad-versace.us> wrote:
> Replace instances of
>     irb->region = region
> with
>     intel_region_reference(&irb->region, region)
> 
> Signed-off-by: Chad Versace <chad at chad-versace.us>

intel_region_alloc returns something with a refcount of 1 -- the
reference you got from the return value.  You're now increasing its
reference on assignment, without decrementing its reference when you
exit the function and no longer need the reference inside the function.
In other words, this change doesn't make sense to me, as it looks like
you'll just leak a ref.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110615/32e246c9/attachment.pgp>


More information about the mesa-dev mailing list