Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit e5ebbf3

Browse files
committed
Fix code analysis and silly code
1 parent 86aaa37 commit e5ebbf3

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/GitHub.App/ViewModels/PullRequestListViewModel.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace GitHub.ViewModels
2222
{
2323
[ExportViewModel(ViewType = UIViewType.PRList)]
2424
[PartCreationPolicy(CreationPolicy.NonShared)]
25-
public class PullRequestListViewModel : BaseViewModel, IPullRequestListViewModel
25+
public class PullRequestListViewModel : BaseViewModel, IPullRequestListViewModel, IDisposable
2626
{
2727
readonly ReactiveCommand<object> openPullRequestCommand;
2828
readonly IRepositoryHost repositoryHost;
@@ -172,9 +172,30 @@ public IAccount SelectedAssignee
172172
set { this.RaiseAndSetIfChanged(ref selectedAssignee, value); }
173173
}
174174

175+
IAccount emptyUser = new Account("[None]", false, false, 0, 0, Observable.Empty<BitmapSource>());
175176
public IAccount EmptyUser
176177
{
177-
get { return new Account("[None]", false, false, 0, 0, Observable.Empty<BitmapSource>()); }
178+
get { return emptyUser; }
179+
}
180+
181+
182+
bool disposed;
183+
protected void Dispose(bool disposing)
184+
{
185+
if (disposing)
186+
{
187+
if (disposed) return;
188+
pullRequests.Dispose();
189+
trackingAuthors.Dispose();
190+
trackingAssignees.Dispose();
191+
disposed = true;
192+
}
193+
}
194+
195+
public void Dispose()
196+
{
197+
Dispose(true);
198+
GC.SuppressFinalize(this);
178199
}
179200
}
180201

0 commit comments

Comments
 (0)