-
Notifications
You must be signed in to change notification settings - Fork 28.4k
[ios]Share extension official example leaks memory causing a crash #165829
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
Comments
Duplicate of #165086 |
Not duplicate - the other issue doesn't require launching the share extension, so isn't related to ShareVC being leaked. |
It turns out that this is because share extensions are allowed to keep running in background after being dismissed (in case of background processing). To deallocate the VC, we have to either However, I did find
Note that we have to pass in the bundle ID as the error domain, otherwise it's gonna crash. Alternatively, we can dismiss using I will update the instruction on the website. |
…rolling behavior (#11882) This PR does 2 things: 1. Fix a memory leak in the instruction. 2. Add instruction on advanced scrolling behavior. I simply link the instruction (instead of copying it since I don't think it's a very common use case). _Issues fixed by this PR (if any):_ flutter/flutter#165829 _PRs or commits this PR depends on (if any):_ ## Presubmit checklist - [ ] This PR is marked as draft with an explanation if not meant to land until a future stable release. - [x] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer.
Website documentation has been updated. |
Steps to reproduce
Follow https://docs.flutter.dev/platform-integration/ios/app-extensions to implement share extension. Use Release mode so it uses less memory to be run on device (220M limit). Launch it a few times and it will crash.
Expected results
Should not crash.
Actual results
It crashes.
From the memory graph, the VC is not released after being dismissed:
The text was updated successfully, but these errors were encountered: