Browse Source

Another fix to Network life cycle.

pull/1/head
Adam Ierymenko 12 years ago
parent
commit
eadff71d37
  1. 10
      node/Network.cpp
  2. 1
      osnet/OSXEthernetTap.cpp

10
node/Network.cpp

@ -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);

1
osnet/OSXEthernetTap.cpp

@ -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…
Cancel
Save