Fix problem that using multi-engines, sometimes OpenGL would crash be cause of invalid EAGLContext (flutter/engine#17366)

This commit is contained in:
wqyfavor
2020-03-27 17:40:56 +08:00
committed by GitHub
parent 27da616b21
commit eff3cb31a1

View File

@@ -70,7 +70,11 @@ IOSRenderTargetGL::~IOSRenderTargetGL() {
glDeleteRenderbuffers(1, &colorbuffer_);
FML_DCHECK(glGetError() == GL_NO_ERROR);
[EAGLContext setCurrentContext:context];
if (context == context_.get()) {
[EAGLContext setCurrentContext:nil];
} else {
[EAGLContext setCurrentContext:context];
}
}
// |IOSRenderTarget|