Skip to content

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

Merged
anandrajeswaran merged 1 commit intomicrosoft:mainfrom
anandrajeswaran:bottom_sheet_demo_retain_cyles
Jan 15, 2025
Merged

[iOS Demo App] Fix retain cycles in bottom sheet demo #2116
anandrajeswaran merged 1 commit intomicrosoft:mainfrom
anandrajeswaran:bottom_sheet_demo_retain_cyles

Conversation

@anandrajeswaran
Copy link
Copy Markdown
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
@anandrajeswaran anandrajeswaran deleted the bottom_sheet_demo_retain_cyles branch January 15, 2025 17:50
@joannaquu joannaquu mentioned this pull request Apr 4, 2025
12 tasks
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