@@ -39,7 +39,6 @@ public RepositoryHosts(
3939 this . connectionManager = connectionManager ;
4040
4141 RepositoryHostFactory = repositoryHostFactory ;
42- disposables . Add ( repositoryHostFactory ) ;
4342 GitHubHost = DisconnectedRepositoryHost ;
4443 EnterpriseHost = DisconnectedRepositoryHost ;
4544
@@ -101,9 +100,7 @@ public RepositoryHosts(
101100 {
102101 var host = LookupHost ( x . HostAddress ) ;
103102 if ( host . Address != x . HostAddress )
104- {
105103 host = RepositoryHostFactory . Create ( x . HostAddress ) ;
106- }
107104 return host ;
108105 } )
109106 . Select ( h => LogOut ( h ) )
@@ -147,7 +144,6 @@ public IObservable<AuthenticationResult> LogIn(
147144 {
148145 var isDotCom = HostAddress . GitHubDotComHostAddress == address ;
149146 var host = RepositoryHostFactory . Create ( address ) ;
150- disposables . Add ( host ) ;
151147 return host . LogIn ( usernameOrEmail , password )
152148 . Catch < AuthenticationResult , Exception > ( Observable . Throw < AuthenticationResult > )
153149 . Do ( result =>
@@ -180,7 +176,6 @@ public IObservable<AuthenticationResult> LogInFromCache(HostAddress address)
180176 {
181177 var isDotCom = HostAddress . GitHubDotComHostAddress == address ;
182178 var host = RepositoryHostFactory . Create ( address ) ;
183- disposables . Add ( host ) ;
184179 return host . LogInFromCache ( )
185180 . Catch < AuthenticationResult , Exception > ( Observable . Throw < AuthenticationResult > )
186181 . Do ( result =>
@@ -210,7 +205,7 @@ public IObservable<Unit> LogOut(IRepositoryHost host)
210205 else
211206 EnterpriseHost = null ;
212207 connectionManager . RemoveConnection ( address ) ;
213- disposables . Remove ( host ) ;
208+ RepositoryHostFactory . Remove ( host ) ;
214209 } ) ;
215210 }
216211
0 commit comments