mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-30 19:40:47 -07:00
Fix for crazy Windows threading bug... repeatedly adding and removing a network now doesn't leave networks in limbo.
This commit is contained in:
parent
44d58ee871
commit
de4e29288d
8 changed files with 166 additions and 169 deletions
|
@ -75,6 +75,9 @@ EthernetTap *WindowsEthernetTapFactory::open(
|
|||
|
||||
void WindowsEthernetTapFactory::close(EthernetTap *tap,bool destroyPersistentDevices)
|
||||
{
|
||||
if (!tap)
|
||||
return;
|
||||
|
||||
std::string instanceId(((WindowsEthernetTap *)tap)->instanceId());
|
||||
Mutex::Lock _l(_devices_m);
|
||||
|
||||
|
@ -120,20 +123,8 @@ void WindowsEthernetTapFactory::destroyAllPersistentTapDevices(const char *pathT
|
|||
dataLen = sizeof(data);
|
||||
if (RegGetValueA(nwAdapters,subkeyName,"DeviceInstanceID",RRF_RT_ANY,&type,(PVOID)data,&dataLen) == ERROR_SUCCESS)
|
||||
instanceIdPath.assign(data,dataLen);
|
||||
if (instanceIdPath.length() != 0) {
|
||||
if (instanceIdPath.length() != 0)
|
||||
instanceIdPathsToRemove.insert(instanceIdPath);
|
||||
/*
|
||||
type = 0;
|
||||
dataLen = sizeof(data);
|
||||
if (RegGetValueA(nwAdapters,subkeyName,"_ZeroTierTapIdentifier",RRF_RT_ANY,&type,(PVOID)data,&dataLen) == ERROR_SUCCESS) {
|
||||
if (dataLen <= 0) {
|
||||
instanceIdPathsToRemove.insert(instanceIdPath);
|
||||
} else {
|
||||
instanceIdPathsToRemove.insert(instanceIdPath);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
} else break; // end of list or failure
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue