mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-26 04:32:47 -04:00
fix(main): destroy temp egl context on init
This commit is contained in:
parent
1aab5931ba
commit
9ae00d7bb2
@ -12,10 +12,12 @@
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
|
||||
static EGLDisplay eglDisplay = EGL_NO_DISPLAY;
|
||||
static EGLSurface eglSurface = EGL_NO_SURFACE;
|
||||
static EGLContext eglContext = EGL_NO_CONTEXT;
|
||||
|
||||
void init_target_egl() {
|
||||
EGLDisplay eglDisplay = EGL_NO_DISPLAY;
|
||||
EGLSurface eglSurface = EGL_NO_SURFACE;
|
||||
EGLContext eglContext = EGL_NO_CONTEXT;
|
||||
|
||||
LOAD_EGL(eglGetProcAddress);
|
||||
LOAD_EGL(eglBindAPI);
|
||||
@ -116,3 +118,16 @@ cleanup:
|
||||
}
|
||||
LOG_E("EGL initialization failed");
|
||||
}
|
||||
|
||||
void destroy_temp_egl_ctx() {
|
||||
LOAD_EGL(eglDestroySurface);
|
||||
LOAD_EGL(eglDestroyContext);
|
||||
LOAD_EGL(eglMakeCurrent);
|
||||
LOAD_EGL(eglTerminate);
|
||||
|
||||
egl_eglMakeCurrent(eglDisplay, 0, 0, EGL_NO_CONTEXT);
|
||||
egl_eglDestroySurface(eglDisplay, eglSurface);
|
||||
egl_eglDestroyContext(eglDisplay, eglContext);
|
||||
|
||||
egl_eglTerminate(eglDisplay);
|
||||
}
|
@ -173,6 +173,7 @@ EGLBoolean mglues_eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface rea
|
||||
*/
|
||||
|
||||
void init_target_egl();
|
||||
void destroy_temp_egl_ctx();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -85,5 +85,7 @@ void proc_init() {
|
||||
init_perfetto();
|
||||
#endif
|
||||
|
||||
// Cleanup
|
||||
destroy_temp_egl_ctx();
|
||||
g_initialized = 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user