enhance: cleanup unused resources
Some checks are pending
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions
Localization Check / localization-check (push) Waiting to run

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-18 22:00:35 +08:00
parent b78f6b0ea8
commit aff003fd6d
No known key found for this signature in database
8 changed files with 51 additions and 26 deletions

View file

@ -44,10 +44,10 @@ namespace SourceGit.ViewModels
}
}
public object Switcher
public IDisposable Switcher
{
get => _switcher;
set => SetProperty(ref _switcher, value);
private set => SetProperty(ref _switcher, value);
}
public Launcher(string startupRepo)
@ -148,12 +148,13 @@ namespace SourceGit.ViewModels
public void CancelSwitcher()
{
Switcher?.Dispose();
Switcher = null;
}
public void SwitchWorkspace(Workspace to)
{
if (to.IsActive)
if (to == null || to.IsActive)
return;
foreach (var one in Pages)
@ -623,6 +624,6 @@ namespace SourceGit.ViewModels
private LauncherPage _activePage = null;
private bool _ignoreIndexChange = false;
private string _title = string.Empty;
private object _switcher = null;
private IDisposable _switcher = null;
}
}