[android] Fix crash on Marshmallow

Fixes #2813
This commit is contained in:
Leith Bade
2015-10-28 00:40:27 +11:00
parent 32c0fb468f
commit 43dde0f204

View File

@@ -423,6 +423,10 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
return reinterpret_cast<mbgl::gl::glProc>(eglGetProcAddress(name));
});
if (oldDisplay == EGL_NO_DISPLAY) {
oldDisplay = display;
}
if (!eglMakeCurrent(oldDisplay, oldDrawSurface, oldReadSurface, oldContext)) {
mbgl::Log::Error(mbgl::Event::OpenGL,
"eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());