mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
prevent cast gesture listener from permanent RIP in one lifecycle
This commit is contained in:
parent
4fffc2d611
commit
ab176c6316
1 changed files with 9 additions and 11 deletions
|
@ -212,19 +212,17 @@ open class ResultFragmentPhone : FullScreenPlayer() {
|
||||||
loadTrailer()
|
loadTrailer()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
super.onDestroy()
|
|
||||||
PanelsChildGestureRegionObserver.Provider.get().apply {
|
|
||||||
resultBinding?.resultCastItems?.let {
|
|
||||||
unregister(it)
|
|
||||||
}
|
|
||||||
removeGestureRegionsUpdateListener(gestureRegionsListener)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroyView() {
|
override fun onDestroyView() {
|
||||||
|
|
||||||
//somehow this still leaks and I dont know why????
|
//somehow this still leaks and I dont know why????
|
||||||
// todo look at https://github.com/discord/OverlappingPanels/blob/70b4a7cf43c6771873b1e091029d332896d41a1a/sample_app/src/main/java/com/discord/sampleapp/MainActivity.kt
|
// todo look at https://github.com/discord/OverlappingPanels/blob/70b4a7cf43c6771873b1e091029d332896d41a1a/sample_app/src/main/java/com/discord/sampleapp/MainActivity.kt
|
||||||
|
PanelsChildGestureRegionObserver.Provider.get().let { obs ->
|
||||||
|
resultBinding?.resultCastItems?.let {
|
||||||
|
obs.unregister(it)
|
||||||
|
}
|
||||||
|
|
||||||
|
obs.removeGestureRegionsUpdateListener(gestureRegionsListener)
|
||||||
|
}
|
||||||
|
|
||||||
updateUIEvent -= ::updateUI
|
updateUIEvent -= ::updateUI
|
||||||
binding = null
|
binding = null
|
||||||
|
@ -1127,4 +1125,4 @@ open class ResultFragmentPhone : FullScreenPlayer() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue