Skip to content
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 bug on MainActivity onDestro. App crashes when closing the app with back button #107

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

fdocr
Copy link
Contributor

@fdocr fdocr commented Nov 9, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

Before closing the app (for example when using the back button) the Main Activity (from onDestroy()) clears out lingering resources like the audio service. The webViewBridge wasn't checking to make sure the service exists before requesting the context to stop it causing the crash.

Killing the app directly from multitasking doesn't seem to execute the onDestroy() and this was a subtle problem that has been flying under the radar until now.

Related Tickets & Documents

Fixes #106

[optional] What gif best describes this PR or how it makes you feel?

doing nothing is everything

@fdocr fdocr changed the title Back btn crash fix Fix bug on MainActivity onDestro. App crashes when closing the app with back button Nov 9, 2020
@fdocr fdocr requested a review from maestromac November 9, 2020 14:37
Copy link
Contributor

@maestromac maestromac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@maestromac maestromac merged commit 82776c6 into master Nov 9, 2020
@maestromac maestromac deleted the fdoxyz/fix-back-btn-crash-106 branch November 9, 2020 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App crashes after closing it
2 participants