Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 46b7793

Browse files
Clear the EGL context only if our context is currently active (#5895)
Fixes flutter/flutter#19566
1 parent 2f4a022 commit 46b7793

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

shell/platform/android/android_context_gl.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ bool AndroidContextGL::MakeCurrent() {
222222
}
223223

224224
bool AndroidContextGL::ClearCurrent() {
225+
if (eglGetCurrentContext() != context_) {
226+
return true;
227+
}
225228
if (eglMakeCurrent(environment_->Display(), EGL_NO_SURFACE, EGL_NO_SURFACE,
226229
EGL_NO_CONTEXT) != EGL_TRUE) {
227230
FML_LOG(ERROR) << "Could not clear the current context";

0 commit comments

Comments
 (0)