Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@KovalevAndrey
Copy link
Contributor

Make children immutable to avoid concurrent modification exception and check if Node has been destroyed before calling lifecycle events

Description:

Related issue(s):

…d check if Node has been destroyed before calling lifecycle events
fun attachChildNode(child: Node<*>) {
verifyNotRoot(child)
_children.add(child)
val newChildren = children.toMutableList().apply { add(child) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

children + child instead?

is AncestryInfo.Child -> ancestryInfo.anchor
}

private var isDestroyed: Boolean = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

get() = lifecycleManager.ribLifecycle.state == Lifecycle.DESTROYED to eliminate possibility of desynchronisation of properties.

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.

2 participants