[Android] Browsers: Fix mediabrowser release
Geoffrey Métais
git at videolan.org
Wed Jul 24 11:32:33 CEST 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jul 24 10:37:34 2019 +0200| [d71c2b168f81fb00070632c0d99d3764af29fff7] | committer: Geoffrey Métais
Browsers: Fix mediabrowser release
releasing was never called because scope was cancelled
> https://code.videolan.org/videolan/vlc-android/commit/d71c2b168f81fb00070632c0d99d3764af29fff7
---
vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
index 031c7627f..7badedb9d 100644
--- a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
@@ -64,7 +64,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
private val completionHandler : CompletionHandler = object : CompletionHandler {
override fun invoke(cause: Throwable?) {
- launch(Dispatchers.IO) {
+ AppScope.launch(Dispatchers.IO) { // use global scope because current is cancelled
mediabrowser?.release()
mediabrowser = null
}
@@ -290,7 +290,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
companion object {
private val browserHandler by lazy {
- val handlerThread = HandlerThread("vlc-mProvider", Process.THREAD_PRIORITY_DEFAULT + Process.THREAD_PRIORITY_LESS_FAVORABLE)
+ val handlerThread = HandlerThread("vlc-provider", Process.THREAD_PRIORITY_DEFAULT + Process.THREAD_PRIORITY_LESS_FAVORABLE)
handlerThread.start()
Handler(handlerThread.looper)
}
More information about the Android
mailing list