Replies: 1 comment 2 replies
-
@tcobb-dk Currently, dependencies are generally considered "static" interfaces, and so you shouldn't depend on any lifecycle guarantees for dependencies themselves. Dependencies attached to objects (like I'm going to convert this to a discussion since we don't consider it to be a bug, but it would be helpful to understand the issue you're having in your project with this behavior, and maybe we can help guide you to another solution. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
in some test setups, using
withDependencies
to mock dependencies results in any resources referenced in the dependencies closure being leaked. they are not released at the end of the test, anddeinit
is not called. for example:after this test runs, the
deinit
inExampleParent
is called, thedeinit
inExampleChild
is not. this style of test setup, returning the constructed object from the operation and testing it externally, is used throughout the documentation. however:after this test runs, the
deinit
in both types is called.here's a minimal project reproducing this issue: DependenciesLeak.zip
Checklist
main
branch of this package.Expected behavior
dependencies are not leaked in either form
Actual behavior
dependencies are leaked in the first form
Steps to reproduce
Dependencies version information
1.4.1
Destination operating system
iOS 15
Xcode version information
Version 15.2 (15C500b)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions