square / Cleanse

Lightweight Swift Dependency Injection Framework
Other
1.78k stars 90 forks source link

Retain a strong reference to all Future Providers. #102

Closed sebastianv1 closed 4 years ago

sebastianv1 commented 5 years ago

If the type was of a AnyWeakProvider type, then we would only retain a weak reference to its FutureProvider instance causing it to become deallocated. We want to retain a strong reference to this FutureProvider like we do for normal providers because we still need to be able to acquire an instance of its getter.