-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
fixed crash if you back out of 2 double engine activities #763
Conversation
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about engineCounter
?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
fixes #762