Skip to content
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

[iOS Demo App] Fix retain cycles in bottom sheet demo #2116

Merged

Conversation

anandrajeswaran
Copy link
Contributor

@anandrajeswaran anandrajeswaran commented Jan 15, 2025

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

We have a few retain cycles (noted by #2106), one where a strong reference to self is sent to a block stored by a strong var of self, the other where a strong reference to a view controller is sent to a block stored by a view in that view controller's hierarchy. Fix both using weak references in these blocks.

Binary change

N/A - No product change

Verification

Sanity in the test app by temporarily adding a deinit to the view controller and a breakpoint confirmed that it is now called when the view controller is dismissed.

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

@anandrajeswaran anandrajeswaran requested a review from a team as a code owner January 15, 2025 03:44
@anandrajeswaran anandrajeswaran merged commit d4b9283 into microsoft:main Jan 15, 2025
7 checks passed
@anandrajeswaran anandrajeswaran deleted the bottom_sheet_demo_retain_cyles branch January 15, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants