mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 15:50:32 +01:00
st/egl: Plug pbuffer leaks.
Unreference validated resources or remove unnecessary validations.
(cherry picked from commit 18bc427ade)
This commit is contained in:
parent
612e26e82c
commit
0dc5b97ddd
1 changed files with 2 additions and 8 deletions
|
|
@ -402,7 +402,6 @@ egl_g3d_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy,
|
|||
_EGLConfig *conf, const EGLint *attribs)
|
||||
{
|
||||
struct egl_g3d_surface *gsurf;
|
||||
struct pipe_resource *ptex = NULL;
|
||||
|
||||
gsurf = create_pbuffer_surface(dpy, conf, attribs,
|
||||
"eglCreatePbufferSurface");
|
||||
|
|
@ -411,13 +410,6 @@ egl_g3d_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy,
|
|||
|
||||
gsurf->client_buffer_type = EGL_NONE;
|
||||
|
||||
if (!gsurf->stfbi->validate(gsurf->stfbi,
|
||||
&gsurf->stvis.render_buffer, 1, &ptex)) {
|
||||
egl_g3d_destroy_st_framebuffer(gsurf->stfbi);
|
||||
FREE(gsurf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &gsurf->base;
|
||||
}
|
||||
|
||||
|
|
@ -477,12 +469,14 @@ egl_g3d_create_pbuffer_from_client_buffer(_EGLDriver *drv, _EGLDisplay *dpy,
|
|||
gsurf->client_buffer_type = buftype;
|
||||
gsurf->client_buffer = buffer;
|
||||
|
||||
/* validate now so that it fails if the client buffer is invalid */
|
||||
if (!gsurf->stfbi->validate(gsurf->stfbi,
|
||||
&gsurf->stvis.render_buffer, 1, &ptex)) {
|
||||
egl_g3d_destroy_st_framebuffer(gsurf->stfbi);
|
||||
FREE(gsurf);
|
||||
return NULL;
|
||||
}
|
||||
pipe_resource_reference(&ptex, NULL);
|
||||
|
||||
return &gsurf->base;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue