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.

MGLOpenGLStyleLayer is released prior to calling MGLFinishCustomStyleLayer  #10755

Closed

Description

@asheemmamoowala

Changes to core GL for asynchronous rendering changed when the mbgl::style::CustomLayer's CustomLayerDeinitializeFunction callback method is invoked.

This callback is now invoked after the layer is removed from a style, and when it's corresponding RenderCustomLayer instance is destroyed.

The [MGLOpenGLStyleLayer setStyle:] method is releasing itself as soon as the layer is removed from the style, which leaves the underlying CustomLayer::Impl instance holding on to a dangling pointer.

This leads to EXC_BAD_ACCESS exceptions with call stack:

#1	0x00000001008745d8 in MGLFinishCustomStyleLayer(void*) 
#2	0x0000000100a5ca20 in mbgl::RenderCustomLayer::~RenderCustomLayer() 
#3	0x0000000100a5caa0 in mbgl::RenderCustomLayer::~RenderCustomLayer() 
#4	0x0000000100a5cad4 in mbgl::RenderCustomLayer::~RenderCustomLayer() 
#5	0x0000000100b637ec in std::__1::default_delete<mbgl::RenderLayer>::operator()(mbgl::RenderLayer*) const 
...
#20	0x0000000100b50b60 in mbgl::Renderer::Impl::render(mbgl::UpdateParameters const&)
#21	0x0000000100b484f0 in mbgl::Renderer::render(mbgl::UpdateParameters const&)
#22	0x000000010077ac7c in MGLRenderFrontend::render()

Activity

  1. added
    Core
    iOS
    macOS
    on Dec 20, 2017
  2. added this to the ios-v3.7.2 milestone on Dec 20, 2017
  3. friedbunny commented on Dec 21, 2017

    @friedbunny
    Contributor

    Fixed in #10765 and the forthcoming v3.7.2 release.

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

    CoreiOSmacOS

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions