From 29a79490babd416c3dc6d33d5ec5fc2be4a17de5 Mon Sep 17 00:00:00 2001 From: Jason T Alborough Date: Fri, 10 Apr 2020 16:29:48 -0400 Subject: [PATCH] #101 Fixes scope issue with CCriticalSection() in ConfigWriter --- .../Config/Essentials/ConfigWriter.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs index 1cd7b93e..cb361d28 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Config/Essentials/ConfigWriter.cs @@ -19,7 +19,8 @@ namespace PepperDash.Essentials.Core.Config public const long WriteTimeout = 30000; - public static CTimer WriteTimer; + public static CTimer WriteTimer; + static CCriticalSection fileLock = new CCriticalSection(); /// /// Updates the config properties of a device @@ -127,8 +128,6 @@ namespace PepperDash.Essentials.Core.Config Debug.Console(0, Debug.ErrorLogLevel.Notice, "Writing Configuration to file"); - var fileLock = new CCriticalSection(); - Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to write config file: '{0}'", filePath); try