Skip to content

Register a disposable #6138

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

Closed
wants to merge 1 commit into from
Closed

Register a disposable #6138

wants to merge 1 commit into from

Conversation

stevemessick
Copy link
Member

I think this
fixes #5940
but I've never been able to reproduce it.

@stevemessick stevemessick requested review from jwren and jacob314 April 25, 2022 22:49
@@ -273,7 +274,6 @@ private void updateCurrentAppChanged(@Nullable FlutterApp app) {
streamSubscriptions.clear();

if (currentStats != null) {
currentStats.dispose();
Copy link
Contributor

Choose a reason for hiding this comment

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

Previously dispose was called on currentStats when the app changed. Now it requires the manager to be disposed. This could lead to memory leaks if you stop and start an app repeatedly depending on what currentStats.dispose() is doing.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jacob314 would it be better to register the parent as app rather than this? There is quite a bit going on in FlutterWidgetPerf.dispose(). Also, is debugActive() called multiple times for a single app? If so, we'd have to keep track of having registered the child with the app.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or we could just catch IncorrectOperationException, which will be thrown if the child is already registered with the app as its parent.

Copy link
Member Author

Choose a reason for hiding this comment

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

n/m closing this. Not sure app is ever disposed, so this is a bigger issue that I thought.

@stevemessick stevemessick deleted the fix-5940 branch May 31, 2022 14:34
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.

Doing a flutter clean while profiling
3 participants