diff options
author | Leith Bade <leith@mapbox.com> | 2015-10-28 00:40:27 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2015-10-28 00:40:27 +1100 |
commit | 43dde0f204ac770feae0ef22c7a4ea67585deb12 (patch) | |
tree | eb5dd11c5a1c8cfcbf174ad5aeab7ba5b5ef853a /platform/android | |
parent | 32c0fb468f21a4ee9fc606d4536c3687c3412b7d (diff) | |
download | qtlocation-mapboxgl-43dde0f204ac770feae0ef22c7a4ea67585deb12.tar.gz |
[android] Fix crash on Marshmallow
Fixes #2813
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/native_map_view.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/android/native_map_view.cpp b/platform/android/native_map_view.cpp index 0a69f2d2da..d0c4cdab00 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<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()); |