new glx: fix memory leak, and bind pixmap

struct _glx_image_data needs to be freed even when refcount is not 0.

Also fixed a typo in glx_bind_pixmap.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-03-10 22:48:42 +00:00
parent cabd0b0801
commit d39d937566
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 2 additions and 2 deletions

View File

@ -164,6 +164,7 @@ void glx_release_image(backend_t *base, void *image_data) {
struct _glx_data *gd = (void *)base;
(*wd->texture.refcount)--;
if (*wd->texture.refcount != 0) {
free(wd);
return;
}
// Release binding
@ -189,7 +190,6 @@ void glx_release_image(backend_t *base, void *image_data) {
// Free structure itself
free(wd);
gl_check_err();
}
@ -368,7 +368,7 @@ glx_bind_pixmap(backend_t *base, xcb_pixmap_t pixmap, struct xvisual_info fmt, b
// Choose a suitable texture target for our pixmap.
// Refer to GLX_EXT_texture_om_pixmap spec to see what are the mean
// of the bits in texture_tgts
if (!(fbcfg->texture_tgts & GLX_TEXTURE_2D_EXT)) {
if (!(fbcfg->texture_tgts & GLX_TEXTURE_2D_BIT_EXT)) {
log_error("Cannot bind pixmap to GL_TEXTURE_2D, giving up");
goto err;
}