Skip to content

Commit 82c7ab0

Browse files
authored
Fix problem that using multi-engines, sometimes OpenGL would crash be cause of invalid EAGLContext (flutter#17366)
1 parent 6d33ee1 commit 82c7ab0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shell/platform/darwin/ios/ios_render_target_gl.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@
7070
glDeleteRenderbuffers(1, &colorbuffer_);
7171

7272
FML_DCHECK(glGetError() == GL_NO_ERROR);
73-
[EAGLContext setCurrentContext:context];
73+
if (context == context_.get()) {
74+
[EAGLContext setCurrentContext:nil];
75+
} else {
76+
[EAGLContext setCurrentContext:context];
77+
}
7478
}
7579

7680
// |IOSRenderTarget|

0 commit comments

Comments
 (0)