mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 04:57:53 +00:00
Another fix to Network life cycle.
This commit is contained in:
parent
af62a6cade
commit
eadff71d37
@ -64,7 +64,11 @@ const char *Network::statusString(const Status s)
|
||||
|
||||
Network::~Network()
|
||||
{
|
||||
Thread::join(_setupThread);
|
||||
_lock.lock();
|
||||
if ((_setupThread)&&(!_destroyed)) {
|
||||
_lock.unlock();
|
||||
Thread::join(_setupThread);
|
||||
} else _lock.unlock();
|
||||
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
@ -414,7 +418,9 @@ void Network::destroy()
|
||||
_enabled = false;
|
||||
_destroyed = true;
|
||||
|
||||
Thread::join(_setupThread);
|
||||
if (_setupThread)
|
||||
Thread::join(_setupThread);
|
||||
_setupThread = Thread();
|
||||
|
||||
if (_tap)
|
||||
_r->tapFactory->close(_tap,true);
|
||||
|
@ -262,6 +262,7 @@ static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
#include "OSXEthernetTap.hpp"
|
||||
|
||||
// ff:ff:ff:ff:ff:ff with no ADI
|
||||
|
Loading…
Reference in New Issue
Block a user