From eeccb0f7d930c330b6219ddbbd2f547948539268 Mon Sep 17 00:00:00 2001 From: llfbandit Date: Thu, 21 Dec 2023 08:44:56 +0100 Subject: [PATCH] fix: Regression on creation sequence when disposing `AudioRecorder` without using it. --- record/CHANGELOG.md | 3 +++ record/lib/src/record.dart | 4 +++- record/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/record/CHANGELOG.md b/record/CHANGELOG.md index 12af2188..6e6bf850 100644 --- a/record/CHANGELOG.md +++ b/record/CHANGELOG.md @@ -1,3 +1,6 @@ +## 5.0.4 +* fix: Regression on creation sequence when disposing `AudioRecorder` without using it. + ## 5.0.3 * fix: Regression on creation sequence when disposing `AudioRecorder` without using it. diff --git a/record/lib/src/record.dart b/record/lib/src/record.dart index ff4a63b2..5e23711a 100644 --- a/record/lib/src/record.dart +++ b/record/lib/src/record.dart @@ -164,7 +164,9 @@ class AudioRecorder { _stateStreamSubscription?.cancel(); _stateStreamCtrl.close(); - await RecordPlatform.instance.dispose(_recorderId); + if (_created != null) { + await RecordPlatform.instance.dispose(_recorderId); + } await _stopRecordStream(); } diff --git a/record/pubspec.yaml b/record/pubspec.yaml index 8b53ad70..712398fb 100644 --- a/record/pubspec.yaml +++ b/record/pubspec.yaml @@ -1,6 +1,6 @@ name: record description: Audio recorder from microphone to file or stream with multiple codecs, bit rate and sampling rate options. -version: 5.0.3 +version: 5.0.4 homepage: https://github.com/llfbandit/record/tree/master/record environment: