From bf09c08e315280da340690aa5bdf9ea1ff738108 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Wed, 9 Feb 2022 16:00:30 +0800 Subject: [PATCH] glx: fix pbuffer refcount init glXMakeCurrent* may miss release pbuffer if pbuffer is created with refcount=0. This won't happen when pbuffer had different GLX id and X pixmap id. cc: mesa-stable Fixes: bc8a51a79a5 ("glx: no need to create extra pixmap for pbuffer") Acked-by: Pierre-Eric Pelloux-Prayer Signed-off-by: Qiang Yu Part-of: --- src/glx/glx_pbuffer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index f7d9a631377..ebd130146d4 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -202,6 +202,8 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config, pdraw->textureTarget = determineTextureTarget(attrib_list, num_attribs); pdraw->textureFormat = determineTextureFormat(attrib_list, num_attribs); + + pdraw->refcount = 1; #endif return GL_TRUE;