Skip to content

fixed crash if you back out of 2 double engine activities #763

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

Merged
merged 3 commits into from
Mar 9, 2021

Conversation

gaaclarke
Copy link
Member

fixes #762

@gaaclarke gaaclarke requested review from xster and redbrogdon March 9, 2021 18:33
@google-cla google-cla bot added the cla: yes Contributor license agreement signed by all authors label Mar 9, 2021
@@ -20,6 +20,10 @@ class DoubleFlutterActivity : FragmentActivity(), EngineBindingsDelegate {
EngineBindings(activity = this, delegate = this, entrypoint = "bottomMain")
}
private val numberOfFlutters = 2
private var engineCountStart = 0
private companion object {
var engineCount = 0
Copy link
Member

Choose a reason for hiding this comment

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

totalEngineCount for readability? Since you have a lot of engine* names in this file.

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO that is a bit misleading because that would suggest it was the number of engines alive, not the number of engines ever made.

Copy link
Member Author

Choose a reason for hiding this comment

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

How about engineCounter?

Copy link
Member

Choose a reason for hiding this comment

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

you're right. Let's leave it as is.

@@ -20,6 +20,10 @@ class DoubleFlutterActivity : FragmentActivity(), EngineBindingsDelegate {
EngineBindings(activity = this, delegate = this, entrypoint = "bottomMain")
}
private val numberOfFlutters = 2
private var engineCountStart = 0
Copy link
Member

Choose a reason for hiding this comment

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

Could this be private val engineCountStart = engineCount? We need to make sure the value never changes through future refactors so the onDestroy start number is right and not leak.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@gaaclarke gaaclarke requested a review from xster March 9, 2021 21:29
@gaaclarke gaaclarke merged commit 680c8ba into flutter:master Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Contributor license agreement signed by all authors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android multiple flutters sample can crash when navigating back through stack
2 participants