Skip to content
Snippets Groups Projects
Commit 2f58ae8d authored by Geoffrey Métais's avatar Geoffrey Métais Committed by Nicolas Pomepuy
Browse files

Browser: clear eventlistener in background

mediabrowser.changeEventListener calls reset() which can lead to block
the current thread
parent becca2a8
No related branches found
No related tags found
1 merge request!900Browser: clear eventlistener in background
Pipeline #66275 passed with stage
in 2 minutes and 22 seconds
......@@ -205,7 +205,9 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
override fun onMediaRemoved(index: Int, media: IMedia) {}
}
requestBrowsing(url, listener, interact)
awaitClose { if (url != null) mediabrowser?.changeEventListener(null) }
awaitClose { if (url != null) AppScope.launch(coroutineContextProvider.IO) {
mediabrowser?.changeEventListener(null) }
}
}.buffer(Channel.UNLIMITED)
open fun addMedia(media: MediaLibraryItem) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment