From 43dde0f204ac770feae0ef22c7a4ea67585deb12 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Wed, 28 Oct 2015 00:40:27 +1100 Subject: [PATCH] [android] Fix crash on Marshmallow Fixes #2813 --- platform/android/native_map_view.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/android/native_map_view.cpp b/platform/android/native_map_view.cpp index 0a69f2d2d..d0c4cdab0 100644 --- a/platform/android/native_map_view.cpp +++ b/platform/android/native_map_view.cpp @@ -423,6 +423,10 @@ void NativeMapView::createSurface(ANativeWindow *window_) { return reinterpret_cast(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());