Browse Source

fix ANDROID-52: synchronization bug with nodeMap

Brenton Bostick 2 years ago
parent
commit
f9528f1248
1 changed files with 3 additions and 4 deletions
  1. 3 4
      java/jni/com_zerotierone_sdk_Node.cpp

+ 3 - 4
java/jni/com_zerotierone_sdk_Node.cpp

@@ -688,10 +688,9 @@ JNIEXPORT void JNICALL Java_com_zerotier_sdk_Node_node_1delete(
     int64_t nodeId = (int64_t)id;
     int64_t nodeId = (int64_t)id;
 
 
     NodeMap::iterator found;
     NodeMap::iterator found;
-    {
-        ZeroTier::Mutex::Lock lock(nodeMapMutex);
-        found = nodeMap.find(nodeId);
-    }
+
+    ZeroTier::Mutex::Lock lock(nodeMapMutex);
+    found = nodeMap.find(nodeId);
 
 
     if(found != nodeMap.end())
     if(found != nodeMap.end())
     {
     {