Skip to content

Commit 043fe76

Browse files
committed
Add settings save lock
1 parent e4577eb commit 043fe76

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public class PublicAPIInstance : IPublicAPI
3737
private readonly Internationalization _translater;
3838
private readonly MainViewModel _mainVM;
3939

40+
private readonly object _saveSettingsLock = new();
41+
4042
#region Constructor
4143

4244
public PublicAPIInstance(Settings settings, Internationalization translater, MainViewModel mainVM)
@@ -92,9 +94,12 @@ public async void RestartApp()
9294

9395
public void SaveAppAllSettings()
9496
{
95-
PluginManager.Save();
96-
_mainVM.Save();
97-
_settings.Save();
97+
lock (_saveSettingsLock)
98+
{
99+
_settings.Save();
100+
PluginManager.Save();
101+
_mainVM.Save();
102+
}
98103
_ = ImageLoader.SaveAsync();
99104
}
100105

0 commit comments

Comments
 (0)