-
Notifications
You must be signed in to change notification settings - Fork 131
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
MAPSAND-366 Fix ANR while open and close MapView quickly with textureView set to true, fix potential crash on RenderHandlerThread creation. #1567
Conversation
Not sure I see how the fix prevents the ANR, could you elaborate? |
sdk/src/test/java/com/mapbox/maps/renderer/RenderHandlerThreadTest.kt
Outdated
Show resolved
Hide resolved
Hi, originally handlerThread was lateinit, so calling the started method would result in a call on an uninitialized object. This fix essentially just ensures that handlerThread is always valid. |
Ok, so it would then crash, and this PR is about preventing this crash and not ANR, got it. |
Yes, this should fix another crash that I noticed just with code inspection. I think Kevin's fix is also combined here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulrenn67 🎉 on your first PR here!
Several notes:
- please add changelog entry, smth like
Fix possible ANR when destroying renderer
- please sign an SLA otherwise PR could not be merged
- rename the PR and update PR description as the scope slightly changed with your fixes
Looks good! |
86f43c2
to
218670c
Compare
@kiryldz hopefully all ok now? |
…nd can cause issues with handler/handlerThread values not being aligned. Added new tests to check start/stop works as expected.
….isRunning as it is more useful to detect a running thread than a started one, and added associated tests
…dBeforeSurfaceWithDestroyTaskInQueueTest
95f4b80
to
b7fb192
Compare
Summary of changes
Lazy initialization of handlerThread is not really needed since anyone who creates an instance of RenderHandlerThread is going to render a map, and can cause issues with handler/handlerThread values not being aligned.
Also fixed and renamed
started
method to avoid potential deadlock due to race condition on some devices whenonSurfaceDestroyed
is called right afterdestroy
.Added new tests to check start/stop works as expected.
User impact (optional)
Pull request checklist:
@JvmOverloads
,@file:JvmName
, etc).make update-api
to update generated api files, if there's public API changes, otherwise theverify-api-*
CI steps might fail.check changelog
CI step will fail.v10.[version]
release branch fix / enhancement, merge it tomain
firstly and then port tov10.[version]
release branch.Fixes: < Link to related issues that will be fixed by this pull request, if they exist >
PRs must be submitted under the terms of our Contributor License Agreement CLA.