diff --git a/CHANGELOG.md b/CHANGELOG.md index bccfaeea..fba10fe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.0.5 +### Web +Release picked file data in memory to avoid memory leak + ## 8.0.4 ### Android Removes references to Flutter v1 android embedding classes. diff --git a/lib/_internal/file_picker_web.dart b/lib/_internal/file_picker_web.dart index f43f127a..0287f20d 100644 --- a/lib/_internal/file_picker_web.dart +++ b/lib/_internal/file_picker_web.dart @@ -169,6 +169,12 @@ class FilePickerWeb extends FilePicker { _target.children.add(uploadInput); uploadInput.click(); + firstChild = _target.firstChild; + while (firstChild != null) { + _target.removeChild(firstChild); + firstChild = _target.firstChild; + } + final List? files = await filesCompleter.future; return files == null ? null : FilePickerResult(files); diff --git a/pubspec.yaml b/pubspec.yaml index 42771cb2..6147c99a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker repository: https://github.com/miguelpruivo/flutter_file_picker issue_tracker: https://github.com/miguelpruivo/flutter_file_picker/issues -version: 8.0.4 +version: 8.0.5 dependencies: flutter: