Skip to content
Snippets Groups Projects
Commit 023282a4 authored by James Xiong's avatar James Xiong Committed by José María Casanova Crespo
Browse files

gallium: do not increase ref count of the new throttle fence

A new throttle fence was initialized to 1, and increased by 1
again when it's put in drawable->throttle_fence; the ref was
decreased by 1 when it's removed from drawable->throttle_fence,
and never reached to 0, caused leak.

Fixes: ff77bf5c ("gallium: simplify throttle implementation")
Closes: mesa/mesa#1949



Signed-off-by: default avatarJames Xiong <james.xiong@intel.com>
Reported-by: default avatarFlorian Wesch <fw@info-beamer.com>
Reviewed-by: default avatarJose Maria Casanova Crespo <jmcasanova@igalia.com>
parent e8095f2a
No related branches found
No related tags found
No related merge requests found
......@@ -489,9 +489,11 @@ dri_flush(__DRIcontext *cPriv,
st->flush(st, flush_flags, &new_fence);
/* throttle on the previous fence */
if (drawable->throttle_fence)
if (drawable->throttle_fence) {
screen->fence_finish(screen, NULL, drawable->throttle_fence, PIPE_TIMEOUT_INFINITE);
screen->fence_reference(screen, &drawable->throttle_fence, new_fence);
screen->fence_reference(screen, &drawable->throttle_fence, NULL);
}
drawable->throttle_fence = new_fence;
}
else if (flags & (__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT)) {
st->flush(st, flush_flags, NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment