Skip to content

Commit

Permalink
Release picked file data for Web
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Jun 11, 2024
1 parent 4bef65a commit a5ed06f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 6 additions & 0 deletions lib/_internal/file_picker_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<PlatformFile>? files = await filesCompleter.future;

return files == null ? null : FilePickerResult(files);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a5ed06f

Please sign in to comment.