mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-05-07 19:18:38 +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()
|
Network::~Network()
|
||||||
{
|
{
|
||||||
|
_lock.lock();
|
||||||
|
if ((_setupThread)&&(!_destroyed)) {
|
||||||
|
_lock.unlock();
|
||||||
Thread::join(_setupThread);
|
Thread::join(_setupThread);
|
||||||
|
} else _lock.unlock();
|
||||||
|
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_lock);
|
Mutex::Lock _l(_lock);
|
||||||
@ -414,7 +418,9 @@ void Network::destroy()
|
|||||||
_enabled = false;
|
_enabled = false;
|
||||||
_destroyed = true;
|
_destroyed = true;
|
||||||
|
|
||||||
|
if (_setupThread)
|
||||||
Thread::join(_setupThread);
|
Thread::join(_setupThread);
|
||||||
|
_setupThread = Thread();
|
||||||
|
|
||||||
if (_tap)
|
if (_tap)
|
||||||
_r->tapFactory->close(_tap,true);
|
_r->tapFactory->close(_tap,true);
|
||||||
|
@ -262,6 +262,7 @@ static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
|
|||||||
|
|
||||||
#include "../node/Constants.hpp"
|
#include "../node/Constants.hpp"
|
||||||
#include "../node/Utils.hpp"
|
#include "../node/Utils.hpp"
|
||||||
|
#include "../node/Mutex.hpp"
|
||||||
#include "OSXEthernetTap.hpp"
|
#include "OSXEthernetTap.hpp"
|
||||||
|
|
||||||
// ff:ff:ff:ff:ff:ff with no ADI
|
// ff:ff:ff:ff:ff:ff with no ADI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user