[Android] Browser: no need to close actor

Geoffrey Métais git at videolan.org
Wed Jul 17 10:51:26 CEST 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jul 17 10:29:33 2019 +0200| [961e9042dcf2a524ba62e2df7b16c7fac5d687cb] | committer: Geoffrey Métais

Browser: no need to close actor

CoroutineScope.cancel() takes care of it

> https://code.videolan.org/videolan/vlc-android/commit/961e9042dcf2a524ba62e2df7b16c7fac5d687cb
---

 vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
index 6adf2ee74..ba257b7db 100644
--- a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
@@ -62,11 +62,11 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
     val descriptionUpdate = MutableLiveData<Pair<Int, String>>()
     internal val medialibrary = AbstractMedialibrary.getInstance()
 
-    private val completionHandler = object : CompletionHandler {
+    private val completionHandler : CompletionHandler = object : CompletionHandler {
         override fun invoke(cause: Throwable?) {
-                mediabrowser?.release()
-                mediabrowser = null
-                if (this at BrowserProvider::browserChannel.isInitialized) browserChannel.close()
+            mediabrowser?.release()
+            mediabrowser = null
+            if (this at BrowserProvider::browserChannel.isInitialized) browserChannel.close()
         }
 
     }
@@ -78,7 +78,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
             Refresh -> refreshImpl()
             ParseSubDirectories -> parseSubDirectoriesImpl()
             ClearListener -> mediabrowser?.changeEventListener(null)
-        } else channel.close()
+        }
     }
 
     protected open fun initBrowser() {



More information about the Android mailing list