Selaa lähdekoodia

egl: Release per-thread resources before unloading (#3337)

Release EGL's per-thread resources before unloading the EGL library to
avoid a potential crash when the render thread is terminated.

Co-authored-by: Sami Kyöstilä <[email protected]>
Sami Kyöstilä 1 vuosi sitten
vanhempi
sitoutus
85726bcb53
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      src/glcontext_egl.cpp

+ 2 - 0
src/glcontext_egl.cpp

@@ -71,6 +71,7 @@ namespace bgfx { namespace gl
 	EGL_IMPORT_FUNC(PFNEGLGETPROCADDRESSPROC,       eglGetProcAddress);       \
 	EGL_IMPORT_FUNC(PFNEGLINITIALIZEPROC,           eglInitialize);           \
 	EGL_IMPORT_FUNC(PFNEGLMAKECURRENTPROC,          eglMakeCurrent);          \
+	EGL_IMPORT_FUNC(PFNEGLRELEASETHREADPROC,        eglReleaseThread);        \
 	EGL_IMPORT_FUNC(PFNEGLSWAPBUFFERSPROC,          eglSwapBuffers);          \
 	EGL_IMPORT_FUNC(PFNEGLSWAPINTERVALPROC,         eglSwapInterval);         \
 	EGL_IMPORT_FUNC(PFNEGLTERMINATEPROC,            eglTerminate);            \
@@ -433,6 +434,7 @@ EGL_IMPORT
 			m_context = NULL;
 		}
 
+		EGL_CHECK(eglReleaseThread() );
 		eglClose(m_eglLibrary);
 
 #	if BX_PLATFORM_RPI