From 49047e239168e5088f64bb1b9fc1ec581955321c Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Mon, 24 May 2021 14:52:07 -0700 Subject: [PATCH] Make Node singleton members static. Fixes UB in C# event logic --- src/bindings/csharp/Node.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bindings/csharp/Node.cs b/src/bindings/csharp/Node.cs index a631a54..5f02ff7 100644 --- a/src/bindings/csharp/Node.cs +++ b/src/bindings/csharp/Node.cs @@ -37,15 +37,15 @@ namespace ZeroTier.Core static int _versionRev; static bool _isOnline = false; static bool _hasBeenFreed = false; - string _configFilePath; - ushort _primaryPort; + static string _configFilePath; + static ushort _primaryPort; static ZeroTierManagedEventCallback _managedCallback; - CSharpCallbackWithStruct _unmanagedCallback; + static CSharpCallbackWithStruct _unmanagedCallback; - ConcurrentDictionary _networks = + static ConcurrentDictionary _networks = new ConcurrentDictionary(); - ConcurrentDictionary _peers = new ConcurrentDictionary(); + static ConcurrentDictionary _peers = new ConcurrentDictionary(); public Node() {