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

@ -189,12 +189,17 @@ namespace SourceGit.ViewModels {
}
public void Close() {
SelectedView = 0.0; // Do NOT modify. Used to remove exists widgets for GC.Collect
_watcher.Dispose();
_histories.Cleanup();
_workingCopy.Cleanup();
_stashesPage.Cleanup();
_watcher = null;
_histories = null;
_workingCopy = null;
_stashesPage = null;
_selectedView = null;
_isSearching = false;
_searchCommitFilter = string.Empty;
@ -205,8 +210,6 @@ namespace SourceGit.ViewModels {
_tags.Clear();
_submodules.Clear();
_searchedCommits.Clear();
GC.Collect();
}
public void OpenInFileManager() {