From de4e29288d30183ca78a5e0878431ed47fa58b8f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 21 Aug 2014 17:49:05 -0700 Subject: Fix for crazy Windows threading bug... repeatedly adding and removing a network now doesn't leave networks in limbo. --- node/Network.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 1d62bdf1..cab41411 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -99,11 +99,6 @@ private: */ static SharedPtr newInstance(const RuntimeEnvironment *renv,NodeConfig *nc,uint64_t id); - /** - * Causes all persistent disk presence to be erased on delete, and this network won't be reloaded on next startup - */ - inline void destroyOnDelete() throw() { _destroyOnDelete = true; } - public: /** * Broadcast multicast group: ff:ff:ff:ff:ff:ff / 0 @@ -419,6 +414,15 @@ public: */ void setEnabled(bool enabled); + /** + * Destroy this network + * + * This causes the network to disable itself, destroy its tap device, and on + * delete to delete all trace of itself on disk and remove any persistent tap + * device instances. Call this when a network is being removed from the system. + */ + void destroy(); + private: static void _CBhandleTapData(void *arg,const MAC &from,const MAC &to,unsigned int etherType,const Buffer<4096> &data); @@ -453,7 +457,7 @@ private: SharedPtr _config; volatile uint64_t _lastConfigUpdate; - volatile bool _destroyOnDelete; + volatile bool _destroyed; volatile enum { NETCONF_FAILURE_NONE, -- cgit v1.2.3