-
Notifications
You must be signed in to change notification settings - Fork 72
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
Singleton not being released after unregister in collaboration container #203
Comments
Maybe try |
weakSingleton could help, but I will need to retain somewhere instance myself. Well yes, I can find workaround for this. But I want to mention this issue to Dip developers. I think it should be fixed somehow. |
@xrayman can you add a test that demonstrates this? |
@ilyapuchka What do you mean by "test"? Test project? |
no, unit test is enough |
@ilyapuchka insert tests into DipTests.swift
|
Hello!
Here's the situation. I have some singletons which are make sense only if user is logged in. So after user is logged out I want to release all those singletons and recreate new instances after the next login. To do that I've separated all those singleton into another container and collaborate it with the main container. Then I register singletons on login and clear second container on logout.
The problem is after I clear the second container singletons are not getting released because main container retains them (but I can't resolve them from main container). They are released only after next login when I register and resolve them again.
Is this an intended behavior?
Code example:
The text was updated successfully, but these errors were encountered: