-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Leak when child dependency is provided to a parent dependency that has a longer lifecycle #188
Labels
bug
Something isn't working
Comments
Closed
evant
added a commit
that referenced
this issue
May 29, 2022
One could leak a dependency by providing a scoped dependency from a component with a shorter lifetime to one with a longer lifetime. We detect this by ensuring the injected dependence's scope is always at least as long as the dependency is it injected into. Unscoped dependencies are always allowed as they don't have any particular lifetime. Fixes #188
Merged
evant
added a commit
that referenced
this issue
May 29, 2022
One could leak a dependency by providing a scoped dependency from a component with a shorter lifetime to one with a longer lifetime. We detect this by ensuring the injected dependence's scope is always at least as long as the dependency is it injected into. Unscoped dependencies are always allowed as they don't have any particular lifetime. Fixes #188
evant
added a commit
that referenced
this issue
May 29, 2022
One could leak a dependency by providing a scoped dependency from a component with a shorter lifetime to one with a longer lifetime. We detect this by ensuring the injected dependence's scope is always at least as long as the dependency is it injected into. Unscoped dependencies are always allowed as they don't have any particular lifetime. Fixes #188
evant
added a commit
that referenced
this issue
May 30, 2022
One could leak a dependency by providing a scoped dependency from a component with a shorter lifetime to one with a longer lifetime. We detect this by ensuring the injected dependence's scope is always at least as long as the dependency is it injected into. Unscoped dependencies are always allowed as they don't have any particular lifetime. Fixes #188
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If a child dependency is provided to a parent dependency, and that parent has a longer lifecycle than the child (e.g. the parent is scoped to an Android application, and the child is scoped to an Android activity), then the child dependency can leak (in the example below, the activity context is leaked):
The text was updated successfully, but these errors were encountered: