RouterStore stores all routers in the wrapper WeakRef<AnyObject>. Since AnyObject is not released, the array of the store gets bigger and bigger and holds more and more nil references (screenshot from example app):
As a consequence, also the retrieve function returns routers that are nil even in the case when there is a not nil router (of the same type) available in the store.
This pull requests cleans up all nil routers when a new router is stored and retrieves not nil routers when there are retrieved.
RouterStore stores all routers in the wrapper
WeakRef<AnyObject>
. Since AnyObject is not released, the array of the store gets bigger and bigger and holds more and more nil references (screenshot from example app):As a consequence, also the retrieve function returns routers that are nil even in the case when there is a not nil router (of the same type) available in the store.
This pull requests cleans up all nil routers when a new router is stored and retrieves not nil routers when there are retrieved.