Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was 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

Description

@zugaldia

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

Activity

  1. added
    Android
    on Jul 9, 2017
  2. tobrun commented on Aug 14, 2017

    @tobrun
    Member

    This was fixed and cherry picked with #9538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions