Skip to content

fix: always run the launchSubcomposition on the main thread #722

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akexorcist
Copy link

Refer to #211, I found that composition.dispose() inside launchSubcomposition(...) must run on the main thread. In instrumented tests, it can be run on other threads, causing crashes because Google Maps couldn't dispose correctly.

To fix this, I've set the launch command within launchSubcomposition to always run on the main thread.

You can reproduce this issue from the https://github.com/akexorcist/maps-compose-ui-test-issue


Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #211 🦕

@akexorcist akexorcist force-pushed the fix/always-dispose-on-main-thread branch from 69de0f8 to 2beb43f Compare July 16, 2025 19:01
@akexorcist akexorcist force-pushed the fix/always-dispose-on-main-thread branch from 2beb43f to 54f1036 Compare July 21, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google map crashed with instrumentation test
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy