@@ -68,8 +68,8 @@ GraphicsContextGLANGLE::~GraphicsContextGLANGLE()
6868 if (m_rendersToHostWindow) {
6969 // When rendering to the host window, destroy the context only, not the surface, as it's the static one.
7070 if (m_contextObj) {
71- EGL_MakeCurrent (m_displayObj, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
7271 EGL_DestroyContext (m_displayObj, m_contextObj);
72+ EGL_MakeCurrent (m_displayObj, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
7373 s_windowSurfaceUsers--;
7474 if (!s_windowSurfaceUsers) {
7575 EGL_DestroySurface (m_displayObj, s_windowSurfaceObj);
@@ -312,10 +312,12 @@ bool GraphicsContextGLTextureMapperANGLE::platformInitializeContext()
312312 }
313313 eglContextAttributes.append (EGL_NONE);
314314
315- m_angleSharingContextObj = sharedDisplay.angleSharingGLContext ();
316- if (m_angleSharingContextObj == EGL_NO_CONTEXT) {
317- LOG (WebGL, " ANGLE sharing EGLContext Initialization failed." );
318- return false ;
315+ if (!m_rendersToHostWindow) {
316+ m_angleSharingContextObj = sharedDisplay.angleSharingGLContext ();
317+ if (m_angleSharingContextObj == EGL_NO_CONTEXT) {
318+ LOG (WebGL, " ANGLE sharing EGLContext Initialization failed." );
319+ return false ;
320+ }
319321 }
320322
321323 m_contextObj = EGL_CreateContext (m_displayObj, m_configObj, m_angleSharingContextObj, eglContextAttributes.data ());
0 commit comments