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

MGLOpenGLStyleLayer is released prior to calling MGLFinishCustomStyleLayer #10755

Closed
asheemmamoowala opened this issue Dec 20, 2017 · 1 comment
Labels
Core The cross-platform C++ core, aka mbgl iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Milestone

Comments

@asheemmamoowala
Copy link
Contributor

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()
@asheemmamoowala asheemmamoowala added Core The cross-platform C++ core, aka mbgl iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Dec 20, 2017
@friedbunny friedbunny added this to the ios-v3.7.2 milestone Dec 20, 2017
@friedbunny
Copy link
Contributor

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

No branches or pull requests

2 participants