Skip to content

Commit

Permalink
Only dispose of instance if all playerKeys are removed (SimformSoluti…
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbajorek authored Jul 30, 2024
1 parent cf04b9f commit f5e4c61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/controllers/player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class PlayerController extends ChangeNotifier {
if (playerState != PlayerState.stopped) await stopPlayer();
await release();
PlatformStreams.instance.playerControllerFactory.remove(playerKey);
if (PlatformStreams.instance.playerControllerFactory.length == 1) {
if (PlatformStreams.instance.playerControllerFactory.isEmpty) {
PlatformStreams.instance.dispose();
}
_isDisposed = true;
Expand Down

0 comments on commit f5e4c61

Please sign in to comment.