Skip to content

Conversation

@gaaclarke
Copy link
Member

fixes: #172105

The migration to ARC accidentally changes the semantics for this ivar. It was previously a weak ptr, this restores that.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@gaaclarke gaaclarke requested a review from a team as a code owner July 28, 2025 17:40
@github-actions github-actions bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) team-ios Owned by iOS platform team labels Jul 28, 2025
@vashworth
Copy link
Contributor

Can you explain more how the ARC migration (86626a8) changed it?

@gaaclarke
Copy link
Member Author

Can you explain more how the ARC migration (86626a8) changed it?

With ARC variables are implicit strong references. Previously it was a weak reference. Hopefully this was a one time flub with the migration. Let me know if you have any more specific questions or want me to explain over vc.

@vashworth
Copy link
Contributor

With ARC variables are implicit strong references. Previously it was a weak reference. Hopefully this was a one time flub with the migration. Let me know if you have any more specific questions or want me to explain over vc.

Gotcha, for future reference for myself, I found this documentation that explains the defaults.

Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@hellohuanlin
Copy link
Contributor

PlatformViewIOS should probably be weak as well?

@gaaclarke
Copy link
Member Author

@gaaclarke gaaclarke added this pull request to the merge queue Jul 30, 2025
Merged via the queue into flutter:master with commit 45d112f Jul 30, 2025
176 checks passed
@gaaclarke gaaclarke deleted the weak-vc-accessibility-bridge branch July 30, 2025 17:22
@hellohuanlin
Copy link
Contributor

This is the correct link: https://github.com/flutter/engine/blob/f20681241753ce4140f39e536cc8fe97507c1ce9/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h#L94

PlatformViewIOS is a c++ class so it doesn't follow the same semantics as objc classes.

I'm wondering if we should use our in-house smart pointers (PtrRef, etc) instead of raw pointers for c++.

ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…172871)

fixes: flutter#172105

The migration to ARC accidentally changes the semantics for this ivar.
[It was previously a weak
ptr](https://github.com/flutter/flutter/blob/303823993244ab930458f3767d86255f76e332d8/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h#L91),
this restores that.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@ala-harri
Copy link

ala-harri commented Sep 16, 2025

@gaaclarke I'm wondering why this fix still not merged to stable release, its been a while

@gaaclarke
Copy link
Member Author

@vashworth would you be interested in accepting this as a cherry-pick? I haven't been keeping track of the release schedule.

@vashworth vashworth added the cp: stable cherry pick this pull request to stable release candidate branch label Sep 18, 2025
flutteractionsbot pushed a commit to flutteractionsbot/flutter that referenced this pull request Sep 18, 2025
…172871)

fixes: flutter#172105

The migration to ARC accidentally changes the semantics for this ivar.
[It was previously a weak
ptr](https://github.com/flutter/flutter/blob/303823993244ab930458f3767d86255f76e332d8/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h#L91),
this restores that.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@vashworth
Copy link
Contributor

@vashworth would you be interested in accepting this as a cherry-pick? I haven't been keeping track of the release schedule.

Sure, looks like it's in beta but not stable yet. I'll make a CP

mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…172871)

fixes: flutter#172105

The migration to ARC accidentally changes the semantics for this ivar.
[It was previously a weak
ptr](https://github.com/flutter/flutter/blob/303823993244ab930458f3767d86255f76e332d8/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h#L91),
this restores that.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…172871)

fixes: flutter#172105

The migration to ARC accidentally changes the semantics for this ivar.
[It was previously a weak
ptr](https://github.com/flutter/flutter/blob/303823993244ab930458f3767d86255f76e332d8/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h#L91),
this restores that.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@justinmc justinmc added cp: stable cherry pick this pull request to stable release candidate branch and removed cp: stable cherry pick this pull request to stable release candidate branch labels Sep 24, 2025
@justinmc
Copy link
Contributor

I'm attempting to restart the automatic cherry pick process here since something seemed to be wrong with the original CP PR (#175595).

justinmc pushed a commit to justinmc/flutter that referenced this pull request Sep 25, 2025
…172871)

fixes: flutter#172105

The migration to ARC accidentally changes the semantics for this ivar.
[It was previously a weak
ptr](https://github.com/flutter/flutter/blob/303823993244ab930458f3767d86255f76e332d8/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h#L91),
this restores that.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
jtmcdole pushed a commit that referenced this pull request Sep 26, 2025
#176030)

This pull request is a manual cherry pick of
#172871 after I had trouble
updating the automatic cherry pick pull request
(#175595).

### Issue Link:
What is the link to the issue this cherry-pick is addressing?

#172105

### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter
developers. See [best
practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md)
for examples

Fixes issue in iOS add-to-app where Flutter view may hang after multiple
transitions.

### Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot
ship an iOS app)? Does it impact development (ex. flutter doctor crashes
when Android Studio is installed), or the shipping production app (the
app crashes on launch)

App may hang after transitioning between multiple pages on iOS.

### Workaround:
Is there a workaround for this issue?

No

### Risk:
What is the risk level of this cherry-pick?

  - [x] Low
  - [ ] Medium
  - [ ] High

### Test Coverage:
Are you confident that your fix is well-tested by automated tests?

  - [x] Yes
  - [ ] No

### Validation Steps:
What are the steps to validate that this fix works?

Using https://github.com/flutter/samples/tree/main/add_to_app/fullscreen
* Launch a Flutter screen
* Dismiss or pop the Flutter screen to return to native
* Repeat the process several times (open Flutter, close, then open
again)
* Flutter screen should not freeze

Co-authored-by: gaaclarke <[email protected]>
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…172871)

fixes: flutter#172105

The migration to ARC accidentally changes the semantics for this ivar.
[It was previously a weak
ptr](https://github.com/flutter/flutter/blob/303823993244ab930458f3767d86255f76e332d8/engine/src/flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h#L91),
this restores that.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) cp: stable cherry pick this pull request to stable release candidate branch engine flutter/engine related. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[add-to-app] Cannot re-open Flutter screen after multiple transitions between iOS native and Flutter

6 participants