这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fixes Semantic Object memory leak cause of wrong release call #18107

Merged
merged 1 commit into from
May 20, 2020

Conversation

zhongwuzw
Copy link
Member

No description provided.

@auto-assign auto-assign bot requested a review from flar May 3, 2020 07:57
@flar flar requested review from gaaclarke, cbracken and goderbauer and removed request for flar May 4, 2020 21:47
Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

This doesn't fix anything, it just converts a manual release to an autorelease pool release. Please file an issue with the problem you are trying to fix. Thanks!

SemanticsObject* delegateObject = [[FlutterSemanticsObject alloc] initWithBridge:weak_ptr
uid:node.id];
SemanticsObject* delegateObject =
[[[FlutterSemanticsObject alloc] initWithBridge:weak_ptr uid:node.id] autorelease];
return (SemanticsObject*)[[[FlutterSwitchSemanticsObject alloc]
initWithSemanticsObject:delegateObject] autorelease];
Copy link
Member Author

Choose a reason for hiding this comment

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

@gaaclarke Here return directly, release statement would not execute.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gaaclarke Hey, can you review this again? 🍻

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

Thanks @zhongwuzw looks good, can you spend a minute looking to see if you can make a test for this?

@gaaclarke
Copy link
Member

I poked around and didn't see an easy way to test beyond looking at retain counts. It's not a huge deal. I just want to find every opportunity to try to build up tests in this code. Thanks @zhongwuzw .

@gaaclarke gaaclarke merged commit 47836dc into flutter:master May 20, 2020
@zhongwuzw zhongwuzw deleted the fix_semantic_memory_leak branch May 21, 2020 01:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants