fix<*>: add cleanups to fix memory leak

This commit is contained in:
leo 2021-05-31 13:55:10 +08:00
parent 13ab3d1eae
commit c3b1b6d502
6 changed files with 37 additions and 10 deletions

View file

@ -27,6 +27,12 @@ namespace SourceGit.Views.Widgets {
var watcher = Models.Watcher.Get(repo.Path);
watcher.BranchChanged += UpdateCommits;
watcher.TagChanged += UpdateCommits;
Unloaded += (o, e) => {
cachedCommits.Clear();
commitList.ItemsSource = cachedCommits;
graph.SetData(cachedCommits, false);
};
}
#region DATA