-
Notifications
You must be signed in to change notification settings - Fork 6k
Wrap the iOS platform message handler in an autorelease pool block #40373
Conversation
With background platform isolate channels, the handler can be invoked on threads that are created by Dart and do not already have an autorelease pool. Fixes flutter/flutter#122792
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be runtime warnings getting printed out if you are adding objects to the autorelease pool but there isn't one present.
If you want to add a test for this it wouldn't be that hard. In platform_message_handler_ios_test.mm
you could make an NSObject that takes in a pointer to a bool and sets it's value in its dealloc. Then you can assert that dealloc was called.
…122942) * e6334f166 [web] Remove image codecs from Canvaskit Chromium (flutter/engine#40309) * 56727d62c Revert "[Impeller] mark decoded images as optimized for GPU access (#40356)" (flutter/engine#40387) * 2cd19e3d1 Wrap the iOS platform message handler in an autorelease pool block (flutter/engine#40373) * bab7853ad Update analyzer for api_conform_test (flutter/engine#40386) * 87b2e82d1 Roll Fuchsia Mac SDK from z32cF6YFs6CvZbY3g... to 4ZrEK2uzGdp_Gz3DU... (flutter/engine#40385) * fc57995fe Ignore some MTLCompiler failures in impeller unit tests (flutter/engine#40391) * 2398c5222 Add doc comment to Pipeline (flutter/engine#40388) * f585d4bc5 [macOS] Remove a single accessibility root assumption (flutter/engine#40316) * 940cf3c98 remove temporary flag and make FlutterTest the default font for real (flutter/engine#40352) * a1bf9fd2a drawTextBlob should not be compatible with opacity inheritance (flutter/engine#40396) * 55bf0d85e Use bundled analyzer everywhere (flutter/engine#40398) * 8e580414a Roll Skia from 9bfb45d3e065 to 49b902e5fb91 (11 revisions) (flutter/engine#40397) * 77c53d25e Default the CanvasKit base URL to local artifacts. (flutter/engine#40293) * 625ea5395 Roll Skia from 49b902e5fb91 to aa983f5486f0 (7 revisions) (flutter/engine#40404) * 867679fac [Impeller] Add playground flag to render for a specific amount of time. (flutter/engine#40377) * d74169608 [Impeller] Remove unused bounds method from typographer interface (flutter/engine#40406) * 941323d77 Provisional iOS impeller flag flip (flutter/engine#40405) * bb971ab55 Revert "Default the CanvasKit base URL to local artifacts. (#40293)" (flutter/engine#40415)
With background platform isolate channels, the handler can be invoked on threads that are created by Dart and do not already have an autorelease pool.
Fixes flutter/flutter#122792