Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Don't crash in image decompression if the context is unavailable. #40890

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

chinmaygarde
Copy link
Member

@chinmaygarde chinmaygarde commented Apr 3, 2023

Fixes flutter/flutter#123027.

Turns out, this isn't an issue with backgrounding. This can only happen if the IO manager is torn down before worker pool has had a chance to process the decompression job, or if the UI manager was never setup. It is hard to imaging how this could happen in a real application. If it does though, we should not crash. This patch makes the change to return an error instead. The linked issue was a test environment and the failure was addressed in #40535.

Fixes flutter/flutter#123027.

Turns out, this isn't an issue with back-grounding. This can only happen if the
IO manager is torn down before worker pool has had a chance to process the
decompression job, or if the UI manager was never setup. It is hard to imaging
how this could happen in a real application. If it does though, we should not
crash. This patch makes the change to return an error instead. The linked issue
was a test environment and the failure was addressed in
flutter#40535.
@chinmaygarde chinmaygarde requested a review from zanderso April 3, 2023 18:47
@chinmaygarde chinmaygarde self-assigned this Apr 3, 2023
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@chinmaygarde chinmaygarde added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 3, 2023
@auto-submit auto-submit bot merged commit 8ded019 into flutter:main Apr 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 3, 2023
@chinmaygarde chinmaygarde deleted the nocontextnocrash branch March 9, 2024 00:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller needs tests
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Impeller] Failure on image load in a background worker thread
2 participants