From 393420ab2d910ede56fc459d57feef5463a9ec88 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 6 Jul 2018 11:52:00 +0200 Subject: [PATCH] use a background thread for releasing exoplayer --- .../simplemobiletools/gallery/fragments/VideoFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt index 10b8190bc..135617e02 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/fragments/VideoFragment.kt @@ -456,8 +456,10 @@ class VideoFragment : ViewPagerFragment(), TextureView.SurfaceTextureListener, S private fun releaseExoPlayer() { mExoPlayer?.stop() - mExoPlayer?.release() - mExoPlayer = null + Thread { + mExoPlayer?.release() + mExoPlayer = null + }.start() } override fun onSurfaceTextureSizeChanged(surface: SurfaceTexture?, width: Int, height: Int) {