Commit 43e23f5b authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Audio player: Fix playlist viewmodel lifecycle

parent f26d90b5
......@@ -451,7 +451,6 @@ class AudioPlayer : Fragment(), PlaylistAdapter.IPlayer, TextWatcher {
super.onDestroy()
if (this::optionsDelegate.isInitialized) optionsDelegate.release()
playlistModel.dataset.removeObserver(playlistObserver)
playlistModel.onCleared()
}
private inner class LongSeekListener(internal var forward: Boolean, internal var normal: Int, internal var pressed: Int) : View.OnTouchListener {
......
......@@ -217,7 +217,7 @@ class PlaylistModel : ScopedModel(), PlaybackService.Callback by EmptyPBSCallbac
}
companion object {
fun get(fragment: Fragment) = ViewModelProviders.of(fragment).get(PlaylistModel::class.java)
fun get(fragment: Fragment) = ViewModelProviders.of(fragment.requireActivity()).get(PlaylistModel::class.java)
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment