From cd8520808edf5f2a4df2349e07077a0199e338ae Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 28 Jun 2017 15:10:33 -0400 Subject: [PATCH] Fixes a potential race condition when reading the Interop port --- TGServerService/Config.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TGServerService/Config.cs b/TGServerService/Config.cs index d085c952c9..80c95d9bb4 100644 --- a/TGServerService/Config.cs +++ b/TGServerService/Config.cs @@ -407,7 +407,10 @@ namespace TGServerService try { error = null; - return Convert.ToUInt16(File.ReadAllText(InteropConfig)); + lock (configLock) + { + return Convert.ToUInt16(File.ReadAllText(InteropConfig)); + } } catch (Exception e) {