Skip to content

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jan 17, 2021

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

This PR fixes a random crash when closing the popup player. I could reproduce it consistently on dev by closing the popup player via the X in the notification, but it also happens on 0.20.8 at random times.

Fixes

Crash log

java.lang.RuntimeException: Unable to stop service org.schabi.newpipe.player.MainPlayer@56760fc: java.lang.IllegalArgumentException: View=android.widget.FrameLayout{759337c V.E...... ........ 0,0-1080,1965} not attached to window manager
	at android.app.ActivityThread.handleStopService(ActivityThread.java:4136)
	at android.app.ActivityThread.access$1900(ActivityThread.java:219)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1896)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7356)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:940)
Caused by: java.lang.IllegalArgumentException: View=android.widget.FrameLayout{759337c V.E...... ........ 0,0-1080,1965} not attached to window manager
	at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:517)
	at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:426)
	at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:121)
	at org.schabi.newpipe.player.Player.removePopupFromView(Player.java:1358)
	at org.schabi.newpipe.player.MainPlayer.onDestroy(MainPlayer.java:192)
	at android.app.ActivityThread.handleStopService(ActivityThread.java:4116)
	... 8 more

Due diligence

@XiangRongLin XiangRongLin added the bug Issue is related to a bug label Jan 17, 2021
@Redirion
Copy link
Member

more a symptomatic fix, but trivial enough to directly merge it. Is also hard to debug.

@Stypox
Copy link
Member Author

Stypox commented Jan 18, 2021

@XiangRongLin feel free to merge ;-)

@XiangRongLin XiangRongLin merged commit 23b5cd5 into TeamNewPipe:dev Jan 18, 2021
This was referenced Jan 18, 2021
tossj pushed a commit to tossj/NewPipe-legacy that referenced this pull request Apr 21, 2021
Prevent IllegalArgumentException when closing popup
@Stypox Stypox deleted the fix-close-popup branch August 4, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants