Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of cancel handling in Android, possibly memory leaks #43

Closed
nagoya0 opened this issue Mar 7, 2019 · 4 comments
Closed

Lack of cancel handling in Android, possibly memory leaks #43

nagoya0 opened this issue Mar 7, 2019 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@nagoya0
Copy link

nagoya0 commented Mar 7, 2019

Hello Miguel,

I'm working on an application using this excellent plugin, and I noticed that FilePicker does not callback if I close file picker in Android.

Because of this, await FilePicker.getFilePath() function call never returns, and occurs memory leaks.

https://github.com/miguelpruivo/plugins_flutter_file_picker/blob/master/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java#L50

if user closes file manager, OS calls onActivityResult() and sets resultCode to Activity.RESULT_CANCEL.

@miguelpruivo
Copy link
Owner

Hi. Looks like a dup of #28. This is already being done. Looking forward a new version with this and more later this week.

Thank you.

@nagoya0
Copy link
Author

nagoya0 commented Mar 7, 2019

Thank you for your quick response.

I checked issue #28 and branch #Roadmap-1.3.0, but it looks like another issue.

Main cause of this issue is, program doesn't call result.success(null) when (resultCode == Activity.RESULT_CANCELED).

@miguelpruivo
Copy link
Owner

miguelpruivo commented Mar 7, 2019

Ok. That's actually when you dismiss the picker and the event is not handled. This is already being handled on iOS but not on Android. I'll add it to the coming update too since it doesn't add too much overhead.

Re-opening.
Thank you for the feedback.

@miguelpruivo miguelpruivo reopened this Mar 7, 2019
@miguelpruivo miguelpruivo added this to the Goals milestone Mar 7, 2019
@miguelpruivo miguelpruivo added bug Something isn't working wip and removed wip labels Mar 7, 2019
@miguelpruivo
Copy link
Owner

Version 1.3.0 was deployed on dart pub and fixes this, alongside with other requested features and bug fixes. See changelog.

Make sure you clean and change your pubspec to the latest version: file_picker: ^1.3.0

Thank you for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants