optimize<*>: reduce memory usage

This commit is contained in:
leo 2024-02-20 18:27:59 +08:00
parent ca19d65f0e
commit 57c4a8394c
8 changed files with 99 additions and 16 deletions

View file

@ -96,6 +96,17 @@ namespace SourceGit.ViewModels {
});
}
public void Cleanup() {
_repo = null;
if (_changes != null) _changes.Clear();
if (_visibleChanges != null) _visibleChanges.Clear();
if (_changeTree != null) _changeTree.Clear();
_selectedChange = null;
_selectedNode = null;
_searchFilter = null;
_diffContext = null;
}
public void NavigateTo(string commitSHA) {
var repo = Preference.FindRepository(_repo);
if (repo != null) repo.NavigateToCommit(commitSHA);