Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction {
weak_factory_(this),
previous_route_id_(0),
previous_routes_({}) {
[view_ retain];
Copy link
Member

Choose a reason for hiding this comment

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

The UIView probably has a reference back to the VC too right? Wouldn't this produce a leak after a VC is dismissed? Since this object is probably never destroyed per engine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, sorta. The UIView would live until a new view controller is presented. This isn't ideal so I'm working on an alternative PR right now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've authored #12232. That will solve the original issue. You know what though, we might still want this PR. This one turns a crash into a leak and that one eliminates both. This might be helpful to protect against future bugs.

accessibility_channel_.reset([[FlutterBasicMessageChannel alloc]
initWithName:@"flutter/accessibility"
binaryMessenger:platform_view->GetOwnerViewController().get().engine.binaryMessenger
Expand All @@ -582,6 +583,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction {
AccessibilityBridge::~AccessibilityBridge() {
clearState();
view_.accessibilityElements = nil;
[view_ release];
}

UIView<UITextInput>* AccessibilityBridge::textInputView() {
Expand Down