Bug 144909

Summary: [EGL][X11] XPixmap created in GLContextEGL::createPixmapContext() is leaked
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: yoon, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch svillar: review+

Description Carlos Garcia Campos 2015-05-12 06:19:29 PDT
The pixmap is created and passed to eglCreatePixmapSurface(), but never released. eglCreatePixmapSurface() doesn't take the ownership of the pixmap, so we should explicitly free it when the GLContextEGL is destroyed.
Comment 1 Carlos Garcia Campos 2015-05-12 06:23:24 PDT
Created attachment 252959 [details]
Patch
Comment 2 Sergio Villar Senin 2015-05-12 06:30:33 PDT
Comment on attachment 252959 [details]
Patch

Makes total sense to me.
Comment 3 Zan Dobersek 2015-05-12 12:50:52 PDT
Comment on attachment 252959 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=252959&action=review

> Source/WebCore/platform/graphics/egl/GLContextEGL.cpp:66
> +    static EGLint attributeList[] = {

This is a bit unusual, since in the project we don't normally modify static data (apart from initialization steps).

> Source/WebCore/platform/graphics/egl/GLContextEGL.cpp:220
> +GLContextEGL::GLContextEGL(EGLContext context, EGLSurface surface, XUniquePixmap&& pixmap)

This constructor should be guarded with PLATFORM(X11).

> Source/WebCore/platform/graphics/egl/GLContextEGL.h:42
> +    GLContextEGL(EGLContext, EGLSurface, XUniquePixmap&&);

Ditto for the PLATFORM(X11) guards.
Comment 4 Carlos Garcia Campos 2015-05-12 23:16:25 PDT
(In reply to comment #3)
> Comment on attachment 252959 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=252959&action=review
> 
> > Source/WebCore/platform/graphics/egl/GLContextEGL.cpp:66
> > +    static EGLint attributeList[] = {
> 
> This is a bit unusual, since in the project we don't normally modify static
> data (apart from initialization steps).

Ok, it's also a bit unrelated to this patch anyway.

> > Source/WebCore/platform/graphics/egl/GLContextEGL.cpp:220
> > +GLContextEGL::GLContextEGL(EGLContext context, EGLSurface surface, XUniquePixmap&& pixmap)
> 
> This constructor should be guarded with PLATFORM(X11).

Right!

> > Source/WebCore/platform/graphics/egl/GLContextEGL.h:42
> > +    GLContextEGL(EGLContext, EGLSurface, XUniquePixmap&&);
> 
> Ditto for the PLATFORM(X11) guards.

Sure.
Comment 5 Carlos Garcia Campos 2015-05-12 23:19:56 PDT
Committed r184273: <http://trac.webkit.org/changeset/184273>