From d9fe82fe4198425cd42081e7fd5bd7ac69aacdd2 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sat, 8 Apr 2017 10:47:12 +1000 Subject: [PATCH] x11: take ownership rather than adding reference for new renderbuffers This avoids locking in the reference calls and fixes a leak after the RefCount initialisation was change from 0 to 1. Fixes: 32141e53d1520 (mesa: tidy up renderbuffer RefCount initialisation) Reviewed-by: Emil Velikov --- src/mesa/drivers/x11/xm_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 82c4d188d5a..5be8aa95de1 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -311,8 +311,8 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, b->frontxrb->Parent = b; b->frontxrb->drawable = d; b->frontxrb->pixmap = (XMesaPixmap) d; - _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT, - &b->frontxrb->Base.Base); + _mesa_add_renderbuffer_without_ref(&b->mesa_buffer, BUFFER_FRONT_LEFT, + &b->frontxrb->Base.Base); /* * Back renderbuffer @@ -328,8 +328,8 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, /* determine back buffer implementation */ b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP; - _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT, - &b->backxrb->Base.Base); + _mesa_add_renderbuffer_without_ref(&b->mesa_buffer, BUFFER_BACK_LEFT, + &b->backxrb->Base.Base); } /* -- 2.30.2