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: