[Android] Browser: Cancel adapter scope on destroy

Geoffrey Métais git at videolan.org
Wed Oct 30 11:48:40 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Oct 30 11:48:12 2019 +0100| [3697cede4cb8c9b6906b2eeec970b26d091beb69] | committer: Geoffrey Métais

Browser: Cancel adapter scope on destroy

> https://code.videolan.org/videolan/vlc-android/commit/3697cede4cb8c9b6906b2eeec970b26d091beb69
---

 vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index 6f01574e2..4fafe845e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -217,6 +217,11 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
         viewModel.stop()
     }
 
+    override fun onDestroy() {
+        adapter.cancel()
+        super.onDestroy()
+    }
+
     override fun onSaveInstanceState(outState: Bundle) {
         outState.putString(KEY_MRL, mrl)
         outState.putParcelable(KEY_MEDIA, currentMedia)



More information about the Android mailing list