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

dismiss choice dialog in onStop() to avoid a leaked window Exception: #6504

Merged
merged 1 commit into from
Jun 17, 2021

Conversation

evermind-zz
Copy link
Contributor

E/WindowManager: android.view.WindowLeaked: Activity org.schabi.newpipe.RouterActivity has leaked window DecorView@d99fe3b[] that was originally added here
at android.view.ViewRootImpl.(ViewRootImpl.java:418)

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • dismiss the dialog correctly so no leaks might occur

APK testing

On the website the APK can be found by going to the "Checks" tab below the title and then on "artifacts" on the right.

Due diligence

E/WindowManager: android.view.WindowLeaked: Activity org.schabi.newpipe.RouterActivity has leaked window DecorView@d99fe3b[] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:418)
@@ -126,6 +127,15 @@ protected void onCreate(final Bundle savedInstanceState) {
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
}

@Override
protected void onStop() {
Copy link
Member

Choose a reason for hiding this comment

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

is there any reason why you decided to use onStop in favor of onPause? I think it could also be put there to be cleared up as early as possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the reason is as @Stypox stated.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

@Redirion It looks good in my opinion, since onStop is called once when the activity is being shut down completely, while onPause may be also called for other reasons (e.g. user turned off the screen, but that shouldn't dismiss dialogs). Thank you @evermind-zz :-)

@Redirion Redirion merged commit 0803d9f into TeamNewPipe:dev Jun 17, 2021
@evermind-zz evermind-zz deleted the fixes-choice-dialog branch June 18, 2021 05:14
This was referenced Jun 26, 2021
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.

3 participants