commit | c9fec61b6cdea5dc912575337e336c86dc32af8c | [log] [tgz] |
---|---|---|
author | stuartmorgan <stuartmorgan@google.com> | Tue Oct 31 07:52:04 2023 -0700 |
committer | GitHub <noreply@github.com> | Tue Oct 31 14:52:04 2023 +0000 |
tree | d817ecbb9a31e21c64f97bfba12b6a18fad96caf | |
parent | b236d83c4a0ad839f7c2cc4ca7d643e80cecf431 [diff] |
[image_picker] Prevent multiple active calls on iOS (#5272) The image picker plugin's implementation doesn't currently handle multiple calls correctly due to the use of an ivar to track the response object; the original entry point handles that by cancelling earlier requests when new ones come in, but as we added more entry points we didn't replicate that logic. This adds it to all picker entry points. (Longer term, we should instead handle multiple concurrent calls, but this is consistent with historical behavior, and is better than having some `await`s on the Dart side never return as can happen now.) The newer PHPicker code path not only didn't cancel, but used an ivar for the picker view controller, which in some cases could result in the same controller being presented multiple times, crashing the app (see referenced issue). While the new cancel calls will prevent that case from happening, to prevent anything similar from happening in the future this removes the ivar entirely, since we can just pass the controller to the necessary methods (as is already being done with the `UIImagePickerController` paths). Fixes https://github.com/flutter/flutter/issues/108900
This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages
directory to see all packages.
These packages are also available on pub.
Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.
If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.
If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.
These are the packages hosted in this repository: