You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In just_audio version 0.9.42, calling the dispose() method on AudioPlayer does not properly close internal streams, potentially leading to resource leaks and increased memory usage.
Steps to Reproduce
Setup:
Add just_audio version 0.9.42 to pubspec.yaml:
dependencies:
just_audio: 0.9.42
Run flutter pub get.
Implement AudioPlayer:
import'package:just_audio/just_audio.dart';
voidmain() {
final player =AudioPlayer();
player.setUrl('https://example.com/audio.mp3');
player.play();
player.dispose();
}
Monitor Resource Usage:
Use profiling tools (e.g., Dart DevTools) to check for memory leaks after disposing the player.
Expected Behavior
Calling dispose() on AudioPlayer should close all internal streams and release resources to prevent memory leaks.
Actual Behavior
Internal streams remain open after dispose() is called, leading to potential resource leaks.
Environment
Package: just_audio 0.9.42
Flutter SDK: 3.27.1
Device: iPhone 13
OS: iOS 17
The text was updated successfully, but these errors were encountered:
Oops, it appears that your issue did not follow the template and is missing one or more required sections. Please open a new issue, and provide all required sections and information.
FAQ:
Do I really need to submit a minimal reproduction project for a bug? A: Yes. I prioritise bugs secondarily on how many people are affected, and primarily on whether the bug report is complete, in the sense that it enables me to immediately reproduce it and start working on a fix. If a bug is important to you, the best thing you can do is to provide all requested information ASAP so that I can start looking into it ASAP.
I think I supplied all required information, so did the bot make a mistake? A: The bot only checks the section headings, so when you post a new issue, make sure you leave the section headings intact. (Note that because of this, it is even possible to trick the bot by including only the section headings, and then not providing the requested information under each heading. This is frowned upon, and the issue will be closed manually.)
haonguyenuet
changed the title
**Bug Report: AudioPlayer.dispose() Does Not Close All Internal Streams**
Bug Report: AudioPlayer.dispose() Does Not Close All Internal Streams (Behavior Subject)
Jan 9, 2025
Description
In
just_audio
version 0.9.42, calling thedispose()
method onAudioPlayer
does not properly close internal streams, potentially leading to resource leaks and increased memory usage.Steps to Reproduce
Setup:
just_audio
version 0.9.42 topubspec.yaml
:flutter pub get
.Implement AudioPlayer:
Monitor Resource Usage:
Expected Behavior
Calling
dispose()
onAudioPlayer
should close all internal streams and release resources to prevent memory leaks.Actual Behavior
Internal streams remain open after
dispose()
is called, leading to potential resource leaks.Environment
The text was updated successfully, but these errors were encountered: