@@ -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 =>
@@ -189,7 +185,6 @@ public IObservable<AuthenticationResult> LogInFromCache(HostAddress address)
189185 {
190186 var isDotCom = HostAddress . GitHubDotComHostAddress == address ;
191187 var host = RepositoryHostFactory . Create ( address ) ;
192- disposables . Add ( host ) ;
193188 return host . LogInFromCache ( )
194189 . Catch < AuthenticationResult , Exception > ( Observable . Throw < AuthenticationResult > )
195190 . Do ( result =>
@@ -219,7 +214,7 @@ public IObservable<Unit> LogOut(IRepositoryHost host)
219214 else
220215 EnterpriseHost = null ;
221216 connectionManager . RemoveConnection ( address ) ;
222- disposables . Remove ( host ) ;
217+ RepositoryHostFactory . Remove ( host ) ;
223218 } ) ;
224219 }
225220
0 commit comments