-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix null-pointer dereference MapRenderer Android #2631
Conversation
Interesting, it looks like that means a render can occur before |
I think onSurfaceCreated dereferences |
I rather suspect it's the other end of the lifecycle, i.e. I don't know the maplibre code, so no idea if Android destroying the surface would cause the |
Right. When |
When the app goes to the background and |
@louwers I experienced the same issue when I upgraded to use the latest map libre android sdk (v11.6.1). Looking into the issue, there seems to be a nullptr dereference on MapRenderer:render method. I believe this happens when the style.json does not include a renderer property in its metadata. I was able to resolve the issue by adding; "maputnik:renderer": "mbgljs" value to the metadata section of the style.json I am using. Can you please verify this and possibly introduce a fix so it does not crash in the absence of this property? We were not aware that it was required as the metadata is listed as 'optional' in the style specs here: https://maplibre.org/maplibre-style-spec/root/#metadata Note 1: Previously, our company was using the v10.2.0 maplibre android sdk, and it was working fine without this property in the style. Note 2: The relevant crash log is attached. |
@elican-doenyas That is a different issue, please open a separate issue. |
In the Android-specific
MapRenderer
class astd::unique_ptr<AndroidRendererBackend>
is dereferenced that may be anullptr
. This can of course lead to a crash, which was reported in #2579I am surprised this has not resulted in more crashes being reported, because I think the null-pointer dereference happens every time
onSurfaceCreated
is (initially) called, and a method is even called on the dereferenced null-pointer...We should probably release 11.1.0 once this is
releasedmerged.