mem leak fix

This commit is contained in:
LagradOst 2021-11-10 23:37:44 +01:00
parent 2a459a0fdd
commit 1628ec56c2
3 changed files with 8 additions and 1 deletions

View file

@ -149,4 +149,7 @@ dependencies {
// Util to skip the URI file fuckery 🙏 // Util to skip the URI file fuckery 🙏
implementation "com.github.tachiyomiorg:unifile:17bec43" implementation "com.github.tachiyomiorg:unifile:17bec43"
// debugImplementation because LeakCanary should only run in debug builds.
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
} }

View file

@ -57,7 +57,10 @@ class DownloadFragment : Fragment() {
} }
override fun onDestroy() { override fun onDestroy() {
downloadDeleteEventListener?.let { VideoDownloadManager.downloadDeleteEvent -= it } if(downloadDeleteEventListener != null) {
VideoDownloadManager.downloadDeleteEvent -= downloadDeleteEventListener!!
downloadDeleteEventListener = null
}
super.onDestroy() super.onDestroy()
} }

View file

@ -1719,6 +1719,7 @@ class PlayerFragment : Fragment() {
} }
override fun onDestroy() { override fun onDestroy() {
MainActivity.playerEventListener = null
/* val lp = activity?.window?.attributes /* val lp = activity?.window?.attributes