Skip to content

Commit

Permalink
Fix unresponsive stop in background.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Mar 5, 2022
1 parent fde34ce commit 8457dcb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions just_audio_background/lib/just_audio_background.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,18 @@ class _JustAudioBackgroundPlugin extends JustAudioPlatform {
@override
Future<DisposePlayerResponse> disposePlayer(
DisposePlayerRequest request) async {
await _player?.release();
final player = _player;
_player = null;
await player?.release();
return DisposePlayerResponse();
}

@override
Future<DisposeAllPlayersResponse> disposeAllPlayers(
DisposeAllPlayersRequest request) async {
await _player?.release();
final player = _player;
_player = null;
await player?.release();
return DisposeAllPlayersResponse();
}
}
Expand Down

0 comments on commit 8457dcb

Please sign in to comment.