Fixed problem saving confCons.xml

Intoduced in commit 9a32aa3350

Removed "_saveUpdate" bool and related checks since it's not used
anywhere else. It was meaningless code (that caused a problem when
ReShaper "cleaned" it up).
This commit is contained in:
Sean Kaim
2016-11-02 15:30:11 -04:00
parent c6b89425b1
commit daad1cac5e

View File

@@ -421,30 +421,25 @@ namespace mRemoteNG.App
public static void SaveConnectionsAsync()
{
_saveUpdate = true;
var t = new Thread(SaveConnectionsBGd);
t.SetApartmentState(ApartmentState.STA);
t.Start();
}
private static bool _saveUpdate;
private static readonly object SaveLock = new object();
private static void SaveConnectionsBGd()
{
Monitor.Enter(SaveLock);
SaveConnections(_saveUpdate);
SaveConnections();
Monitor.Exit(SaveLock);
}
public static void SaveConnections(bool update = false)
public static void SaveConnections()
{
if (ConnectionTreeModel == null) return;
try
{
if (update && Settings.Default.UseSQLServer == false)
return;
RemoteConnectionsSyncronizer?.Disable();
var connectionsSaver = new ConnectionsSaver();