Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Version used:1.8.2
Devices/Android versions reproduced on:13
ComponentDialog source onStop()
@CallSuper
override fun onStop() {
// This is the closest thing to onDestroy that a Dialog has
lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY)
_lifecycleRegistry = null
super.onStop()
}
Life cycle events are handled here, and _lifecycleRegistry = null is not appropriate.
This is because the status of moveToState is checked in handleLifecycleEvent
check(! (state == State.INITIALIZED && next == State.DESTROYED)) {
"no event down from $state in component ${lifecycleOwner.get()}"
}
dismissDialog() executes onStop() when called; dismissDialog() crashes when executed multiple times, the first time _lifecycleRegistry = null, the second dismissDialog() onStop()
_lifecycleRegistry is the initial State.INITIALIZED,
This must be done by the developer manually clearing the dismissDialog() event from elsewhere after it has called it, to avoid crashing. When multiple event sources execute dismissDialog(), it is easy to miss to dismiss all other events, and this code is written like a piece of shit. Perhaps developers have not yet looked at the ComponentDialog source code for use
It's very easy to crash a developer's app