[Fix] (MG_State/EGLState, MG_Backend): defer current EGL surface destruction

This commit is contained in:
2026-07-03 10:14:26 +08:00
parent ce2b5a793f
commit 6418561d3c
9 changed files with 114 additions and 52 deletions
+3
View File
@@ -169,6 +169,7 @@ namespace MobileGL {
EGLDisplayHandle Display = EGL_NO_DISPLAY;
EGLConfigHandle Config = nullptr;
SurfaceType Type = SurfaceType::Window;
Bool DestroyPending = false;
Uint64 NativeHandleKey = 0;
EGLClientBuffer ClientBuffer = nullptr;
EGLenum BufferType = EGL_NONE;
@@ -232,6 +233,8 @@ namespace MobileGL {
void ReleaseDisplayObjects(EGLDisplayHandle display);
void ReleaseThreadUnlocked(const std::thread::id& threadKey);
Bool IsSurfaceCurrentUnlocked(EGLSurfaceHandle surface) const;
void DestroyPendingSurfaceIfUnused(EGLSurfaceHandle surface);
private:
mutable std::recursive_mutex m_mutex;