mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
optimize<*>: reduce memory usage
This commit is contained in:
parent
ca19d65f0e
commit
57c4a8394c
8 changed files with 99 additions and 16 deletions
|
@ -56,6 +56,22 @@ namespace SourceGit.ViewModels {
|
|||
_repo = repo;
|
||||
}
|
||||
|
||||
public void Cleanup() {
|
||||
Commits = new List<Models.Commit>();
|
||||
|
||||
_repo = null;
|
||||
_graph = null;
|
||||
_autoSelectedCommit = null;
|
||||
|
||||
if (_detailContext is CommitDetail cd) {
|
||||
cd.Cleanup();
|
||||
} else if (_detailContext is RevisionCompare rc) {
|
||||
rc.Cleanup();
|
||||
}
|
||||
|
||||
_detailContext = null;
|
||||
}
|
||||
|
||||
public void NavigateTo(string commitSHA) {
|
||||
var commit = _commits.Find(x => x.SHA.StartsWith(commitSHA));
|
||||
if (commit != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue