Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

EGL_BAD_SURFACE returned when using MapView.onDestroy() with multiple mapviews #9458

Closed
zugaldia opened this issue Jul 7, 2017 · 1 comment
Labels
Android Mapbox Maps SDK for Android

Comments

@zugaldia
Copy link
Member

zugaldia commented Jul 7, 2017

Looks like that when having multiple Map Views with a Custom Layer a race condition might occur that causes an EGL_BAD_SURFACE error.

For example, let's suppose two maps are present, one in the background and another one as a dialog. When the dialog map shows up fine and gets destroyed, "active" count inside native_map_view.cpp will stay 0 or 1, but when a custom layer is added, sometimes it will go over to 3, so when the control is released back, the original NativeMap will never take control again.

the 07-05 17:18:15.778 29086 29086 I mbgl    : {t.android.debug}[Android]: Trying to activate -1111333760, 0
07-05 17:18:15.778 29086 29086 I mbgl    : {t.android.debug}[Android]: Activated -1111333760
07-05 17:18:15.787 29086 29086 I mbgl    : {t.android.debug}[Android]: Trying to deactivate -1111333760, 1
07-05 17:18:15.787 29086 29086 I mbgl    : {t.android.debug}[Android]: Deactivated -1111333760
07-05 17:18:15.791 29086 29086 I mbgl    : {t.android.debug}[Android]: Trying to activate -1111333760, 0
07-05 17:18:15.791 29086 29086 I mbgl    : {t.android.debug}[Android]: Activated -1111333760
07-05 17:18:15.791 29086 29086 I mbgl    : {t.android.debug}[General]: New custom layer Impl: my_map
07-05 17:18:15.791 29086 29086 I mbgl    : {t.android.debug}[General]: New custom layer: my_map
07-05 17:18:15.792 29086 29086 I mbgl    : {t.android.debug}[Android]: Trying to activate -1111333760, 1
07-05 17:18:15.792 29086 29894 D nyc_MapRenderingLayer: Map rendering prepare has been called.
07-05 17:18:15.792 29086 29086 I mbgl    : {t.android.debug}[Android]: Trying to activate -1111333760, 2
07-05 17:18:15.792 29086 29894 D nyc_MapRenderingLayer: Layers added above sc-layers-insert
07-05 17:18:15.793 29086 29086 I mbgl    : {t.android.debug}[Android]: Trying to deactivate -1111333760, 3

cc: @kkaefer @tobrun

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Jul 9, 2017
@tobrun
Copy link
Member

tobrun commented Aug 14, 2017

This was fixed and cherry picked with #9538

@tobrun tobrun closed this as completed Aug 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

2 participants