Skip to content
Permalink
Browse files
Properly uninitialize EGL display before termination
https://bugs.webkit.org/show_bug.cgi?id=236766

From the docs [1], if contexts or surfaces associated with display
is current to any thread, they are not released until they
are no longer current as a result of eglMakeCurrent.

So call eglMakeCurrent() to such effect.

[1] https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglMakeCurrent.xhtml

Reviewed by Carlos Garcia Campos.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::terminateEGLDisplay):



Canonical link: https://commits.webkit.org/247622@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
psaavedra committed Feb 22, 2022
1 parent 85a3fb3 commit 97a1de744a21d634e90a367c63435780d23efe3e
Showing 2 changed files with 19 additions and 0 deletions.
@@ -1,3 +1,21 @@
2022-02-22 Pablo Saavedra <psaavedra@igalia.com>

Properly uninitialize EGL display before termination
https://bugs.webkit.org/show_bug.cgi?id=236766

From the docs [1], if contexts or surfaces associated with display
is current to any thread, they are not released until they
are no longer current as a result of eglMakeCurrent.

So call eglMakeCurrent() to such effect.

[1] https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglMakeCurrent.xhtml

Reviewed by Carlos Garcia Campos.

* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::terminateEGLDisplay):

2022-02-22 Chris Dumez <cdumez@apple.com>

Avoid having to iterate the whole frame tree(s) every time we need to dispatch storage events
@@ -278,6 +278,7 @@ void PlatformDisplay::terminateEGLDisplay()
ASSERT(m_eglDisplayInitialized);
if (m_eglDisplay == EGL_NO_DISPLAY)
return;
eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglTerminate(m_eglDisplay);
m_eglDisplay = EGL_NO_DISPLAY;
}

0 comments on commit 97a1de7

Please sign in to comment.