Skip to content

Commit

Permalink
added deinit in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alnitak committed Aug 23, 2024
1 parent 5ce0a77 commit a455ab4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions example/lib/filters/pitchshift.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ class _PitchShiftState extends State<PitchShift> {
}
}

@override
void dispose() {
SoLoud.instance.deinit();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down
6 changes: 6 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class HelloFlutterSoLoud extends StatefulWidget {
class _HelloFlutterSoLoudState extends State<HelloFlutterSoLoud> {
AudioSource? currentSound;

@override
void dispose() {
SoLoud.instance.deinit();
super.dispose();
}

@override
Widget build(BuildContext context) {
if (!SoLoud.instance.isInitialized) return const SizedBox.shrink();
Expand Down
6 changes: 6 additions & 0 deletions example/lib/metronome/metronome.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ class _MetronomeState extends State<Metronome> {
});
}

@override
void dispose() {
SoLoud.instance.deinit();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down

0 comments on commit a455ab4

Please sign in to comment.